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

BrickColor

Asked by 10 years ago

Ok so I made a function script to that if a something touches a brick, then it makes another brick turn a different color, but I wont work so here is my script

function onTouched(hit)
    Workspace.Papi1.BrickColor = BrickColor.new("Institutional white") 
wait(0)
end
script.Parent.Touched:connect(onTouched) 

So if someone could reply with the correct script that would be great! Thanks

2 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
part = game.Workspace["Papi1"]
part.BrickColor = BrickColor.new("Institutional white")
end
end)
0
Thanks man ill try it! IncognitoPlane 0 — 10y
0
Thank you so much dude! It worked!! IncognitoPlane 0 — 10y
0
No problem! Shawnyg 4330 — 10y
0
:d User#11440 120 — 8y
Ad
Log in to vote
0
Answered by 5 years ago

I know why. Instead of Workspace put game.Workspace or workspace

Answer this question