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

For some reason this change color whit click detector don't work (?)

Asked by 2 years ago

Ok there is a error on "=" i don't know what to put

function onClicked(playerWhoClicked)
    local=workspace.script.parent
    workspace.bloq.BrickColor = BrickColor.random()
    wait(0.5)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
2
Answered by
SuperPuiu 497 Moderation Voter
2 years ago

You forgot to add a variable after local

function onClicked(playerWhoClicked)
    local var =workspace.script.parent -- workspace.script.Parent might not work
    workspace.bloq.BrickColor = BrickColor.random()
    wait(0.5)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
0
Thanks, im new in this :> xXmartinyeahXx 2 — 2y
Ad

Answer this question