Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with my game?

Asked by 11 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I'm making an rpg game, and someone gave me a script to use for the armour door, when you touch it if you are a high enough level it is supposed to let you through, but the script is not working and it is not letting me through. Here is the script:

01function getPlayer(humanoid)
02local players = game.Players:children()
03for i = 1, #players do
04if players[i].Character.Humanoid == humanoid then return players[i] end
05end
06end
07 
08Door = script.Parent
09function onTouched(hit)
10print("Door Hit")
11local human = hit.Parent:findFirstChild("Humanoid")
12if (human ~= nil ) then
13print("Human touched door")
14local player = getPlayer(human)
15 
View all 33 lines...

1 answer

Log in to vote
0
Answered by 11 years ago

all I see is that the last line should read Door:connect(onTouched)

Ad

Answer this question