There is a end missing and it's BrickColor, with capital c.
So it would be like this:
Brick = script.Parent
AnotherBrick = game.Workspace.TP
if game.Workspace.Screen.BrickColor.Name == "Bright green" then
Brick.Touched:connect(function(part)
if part.Parent.Humanoid then
if part.Parent.Humanoid.Health > 0 then
part.Parent:MoveTo(AnotherBrick.Position)
end
end
end)
end
A hint: use http://wiki.roblox.com/index.php?title=Output, it's really useful to find out what is wrong in your code. Run the script and check output to see if nothing is wrong.
Edit:
Ok, I tried it in studio and worked perfectly. Just changed a line here to make more sense:
Brick = script.Parent
AnotherBrick = game.Workspace.TP
Brick.Touched:connect(function(part)
if game.Workspace.Screen.BrickColor.Name == "Bright green" then
if part.Parent:FindFirstChild("Humanoid") then
if part.Parent.Humanoid.Health > 0 then
part.Parent:MoveTo(AnotherBrick.Position)
end
end
end
end)
3 comments
Mind putting it in code block?
Oh, sorry, sure
Okay, it's in code block