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

my ClickDetector button script not working what do i do?

Asked by 4 years ago

i have a script for a clicky brick thats supposed to change a BoolValue and im not sure why it isnt working but i still am quite a noob so im not sure


local s = script.Parent local val = workspace.GameData.Close function setval() s.Color = BrickColor.new("Lime green") val.Value = true wait(0.5) s.Color = BrickColor.new("Really red") end s.CD.MouseClick:Connect(setval)
0
What class is Close? MegaManSam1 207 — 4y
0
are there any errors from the output? Lunaify 66 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
-- Server Script

local Part = script.Parent -- Part where the ClickDetector is
local ClickDetector = Part.ClickDetector -- Our click ClickDetector
local val = workspace.GameData.Close -- Our closed check

ClickDetector.MouseClick:Connect(function()
    Part.BrickColor = BrickColor.new("Lime green") -- Sets to lime green
    val.Value = true -- Sets the val to true
    wait(.5) -- .5 delay
    Part.BrickColor = BrickColor.new("Really red") -- Sets to really red
end)

Hope this works.

Ad

Answer this question