thanks but I'm terriable at scripting so I don't know how to join it up plz help.
I'm trying to make a script that when someone stands on it it makes a different block turn green then back to red plz help its here.
while true do ontouch.Parent = wait(2) 'Part1' colour:Limegreen wait (2) then 'Part1' = colour:Really red end end
Well.
I'm not sure if that's even Lua, but let's get on with it:
There's a property of parts called Touched. You want to change the color of the part, so first you'll need to hook up a function to fire when the part is touched. How would we do that? Like this
--A script, inside of a part, inside of whatever. script.Parent.Touched:connect(function() end)
Good, so now we have that. Now, to changed color, there is another property that changes the color of something; it's called BrickColor. To change this property with a script, we would do this:
game.Workspace.Part.BrickColor = BrickColor.new("Bright red")
So, what can we do with the two things that we just learned? We can hook up the event to change the brick color based on what the brickcolor already is, like so:
script.Parent.Touched:connect(function() if script.Parent.BrickColor == "Black" then script.Parent.BrickColor = BrickColor.new("White") end if script.Parent.BrickColor == "White" then script.Parent.BrickColor = BrickColor.new("Black") end end)
On a final note, you should always check the wiki for a tutorial. I know there's one on the wiki having to do something with this.
Hope this helps.