Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

VIP Door - What am I doing wrong?

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..

1 comment

0

The code and its tildas have to be on their own lines. Please edit your post to correct the formatting

1 answer

✓ Accepted answer
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)

This discussion is preserved as it was. New answers, comments, and votes are closed.