I need help with my game?
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:
01 | function getPlayer(humanoid) |
02 | local players = game.Players:children() |
04 | if players [ i ] .Character.Humanoid = = humanoid then return players [ i ] end |
09 | function onTouched(hit) |
11 | local human = hit.Parent:findFirstChild( "Humanoid" ) |
12 | if (human ~ = nil ) then |
13 | print ( "Human touched door" ) |
14 | local player = getPlayer(human) |
16 | if (player = = nil ) then return end |
17 | local stats = player:findFirstChild( "leaderstats" ) |
18 | local sp = stats:findFirstChild( "Level" ) |
19 | if sp = = nil then return false end |
20 | if (sp.Value > = 1 ) then |
21 | print ( "Human passed test" ) |
23 | Door.CanCollide = false |
33 | connection = Door.Touched:connect(onTouched) |