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

What is wrong with this simple ontouched script? (SOLVED)

I am trying to make a simple ontouched script that when you touch a brick, it turns red

function onTouched(hit)
	game.Workspace.Ebin.BrickColor.New = "Bright Red"
end

Script.Parent.Touched:connect (onTouched)

1 comment

0

Take out the .New, and put parentheses around "Bright Red".

2 answers

✓ Accepted answer

well here is the script you Need to use for right now.

game.Workspace.Ebin.Touched:connect(function(hit)
	game.Workspace.Ebin.BrickColor = BrickColor.new("Bright red")
end)

here is everything you did wrong

function onTouched(hit) game.Workspace.Ebin.BrickColor.New = "Bright Red" end --Brickcolor.new
-- Brickcolor = Brickcolor.new("Bright red")

Script.Parent.Touched:connect (onTouched)

2 comments

0

Oh thank you :D

0

If you would Press that Vote up Button It would be much Appreciated :D

function ot() 
script.Parent.BrickColor = BrickColor.new("Bright red")
end 
script.Parent.Touched:connect(ot) 

Just copy and paste this script and insert it into a brick. Hope it helps !

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