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

VIP Door - What am I doing wrong?

Asked by 10 years ago

Apparently ~~~~~~~~~~~~~~~~ local Door = script.Parent function onTouch(Door) Brick = Brick.Parent:findFirstChild("Humanoid") Parent.Torso.Texture = "http://www.roblox.com/asset/?id=2133323" if (Player ~= nil) then Player.Health = 0 end end Door.Touched:connect(onTouch) ~~~~~~~~~~~~~~~~~ it isn't working..

0
The code and its tildas have to be on their own lines. Please edit your post to correct the formatting BlueTaslem 18071 — 10y

1 answer

Log in to vote
0
Answered by
Ekkoh 635 Moderation Voter
10 years ago
local Door = script.Parent
function onTouch(Brick) -- the argument is the part that touches the door, not the door itself 
    local hum = Brick.Parent:findFirstChild("Humanoid") -- i wouldn't use the variable name brick if it's already being used
    if hum and Brick.Parent.Torso.roblox.Texture ~= "http://www.roblox.com/asset/?id=2133323" then
        Brick.Parent:BreakJoints()
    end 
end 

Door.Touched:connect(onTouch)
Ad

Answer this question