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

How do i turn an obect a different color when you click it?

Asked by
65E0 11
3 years ago

I made a button that Deleted the baseplate and turned black at the same time

This is the code i used:

function onClicked() local counter = 0 while(counter <531) do game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() game.Workspace.Baseplate:Destroy() counter = counter + 1 wait(0.003) if (counter <= 530) then script.Parent.Color = ('0,0,0')

end

end script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
0
Answered by 3 years ago
script.Parent.Color = Color3.new(0, 0, 0)


Color3 describes a color using RGB.

0
Color uses Color3 as its value type. CountOnMeBro 51 — 3y
Ad

Answer this question