of     174   
chevron_rightchevron_rightchevron_right

KoopaLab
#19891Friday, March 23, 2007 4:36 PM GMT

Hio, so here is my question. Can you set up a onTouch function so that instead of having a humanoid touching the brick to start the function could you make it so that it would need to be touched by a certian brick? Not just a brick and not humaniods, but only a specific brick. I have tried this and havent really gotten it to work... It might be a really easy answer.... lol Koopa
Telamon
#19895Friday, March 23, 2007 4:56 PM GMT

Hello Koopa, There is a clever way that you can do this. When you connect to the Touched event of a Part, onTouched will be called every time another Part hits it. The colliding part is passed into the onTouched handler as a parameter. In the example below, that parameter is the variable called "hit". If we want to make a special key that needs to touch the door before it can open, we can make another brick, name it "Key", and then do this: print("Simple Secret Door Script Loaded") Door = script.Parent function onTouched(hit) if (hit.Name == "Key") then print("Door Unlocked") end end connection = Door.Touched:connect(onTouched) Neat, huh? You could also make a script that does something whenever a Red part touches it, or whenever a big part touches it, or whenever a ball touches it, ect ect. On thing - BM says that if you are dragging a part over another part, no Touch events are fired until the part is dropped. Also no Touch events will be fired if the dragged brick snaps to the listening brick. So making a door like this may or may not be tricky. -T
KoopaLab
#19897Friday, March 23, 2007 5:02 PM GMT

Sweet! good, i have some great ideas for this. Thanks Telamon. I got to get this one stuck in my head so i remember it now. Koopa
koopa
#20618Thursday, March 29, 2007 7:00 PM GMT

So, instead of starting a whole new thread, i am just reviving this old one since i have a question along with the same topic. I have tried this, which is exactly what was said above. print("Simple Secret Door Script Loaded") Door = script.Parent function onTouched(hit) if (hit.Name == "Key") then print("Door Unlocked") end end connection = Door.Touched:connect(onTouched) Problem is, i never get the "Door Unlocked" in my output window. I have tried adding after the print Door.Transparency = 0.5 just so it would be more visible but nothing happens. I have also tried labeling what "Key" is, so i did something like this. game.Workspace.Key = Key Key = ("Key") I did it like that and not like this because i kept getting a error message. game.Workspace.Key = ("Key") So, i am not sure how to actually get this to work now... lol Is there something i am not doing correctly? As always, and helpfull comments are greatly appreciated. Koopa
KoopaMapMaker
#20750Friday, March 30, 2007 6:40 PM GMT

Sorry, but this needs a bump... So Bumpity bump. Koopa
stang90
#20755Friday, March 30, 2007 7:25 PM GMT

so your sorta makein a door that opens whith a key?
koopa
#20756Friday, March 30, 2007 7:29 PM GMT

Not quite... at least not yet lol, but yes thats the general idea. Koopa
miked
#20760Friday, March 30, 2007 7:38 PM GMT

Name an actual brick "Key" and make it touch it, if this is not what you are doing already. I dont see why it should not work. The stuff after the actual script has errors: 1. game.Workspace.Key = Key - You cant do this, did you mean to put: Key = game.Workspace.Key 2. game.Workspace.Key = ("Key") - game.Workspace.Key is a part, and you are telling the part to become a string, which you just cant do. If you are trying to name it you must do: game.Workspace.Key.Name = "Key"
koopa
#20761Friday, March 30, 2007 7:44 PM GMT

Ya, the first one is probably just a typo. I will try what you said for the second part. That couldave been my problem. Thanks for the suggestions! :) Koopa
koopa
#20762Friday, March 30, 2007 7:49 PM GMT

Yup, like you said Miked i just needed that one little part to be like this. game.Workspace.Key.Name = "Key" It works great now, thanks for the help! TY Koopa
ROBLOX_Marksman
#101200643Friday, June 14, 2013 9:59 AM GMT

bump lol umad #9 top poster, #5 top active
jcs802
#101200717Friday, June 14, 2013 10:01 AM GMT

11 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200744Friday, June 14, 2013 10:01 AM GMT

12 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200764Friday, June 14, 2013 10:02 AM GMT

13 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200784Friday, June 14, 2013 10:03 AM GMT

14 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200814Friday, June 14, 2013 10:03 AM GMT

15 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200845Friday, June 14, 2013 10:04 AM GMT

16 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200869Friday, June 14, 2013 10:04 AM GMT

17 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200891Friday, June 14, 2013 10:05 AM GMT

18 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200911Friday, June 14, 2013 10:06 AM GMT

19 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200933Friday, June 14, 2013 10:06 AM GMT

20 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200951Friday, June 14, 2013 10:07 AM GMT

21 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200974Friday, June 14, 2013 10:07 AM GMT

22 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101200998Friday, June 14, 2013 10:08 AM GMT

23 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW
jcs802
#101201022Friday, June 14, 2013 10:08 AM GMT

24 lol still a long time secret forum JOIN MY PRIMARY PEOPLE NOWWWWWWWWWWWWW

    of     174   
chevron_rightchevron_rightchevron_right