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

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

Asked by 10 years ago

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)
0
Take out the .New, and put parentheses around "Bright Red". emite1000 335 — 10y

2 answers

Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
10 years ago

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)
0
Oh thank you :D robuxlover1 5 — 10y
0
If you would Press that Vote up Button It would be much Appreciated :D IcyEvil 260 — 10y
Ad
Log in to vote
0
Answered by
Seraine 103
10 years ago
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 !

Answer this question