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

colour changes once but then doesnt?

Asked by
MHaven1 159
5 years ago
Edited 5 years ago
--localscript--
script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Check.Value == true Then
        game.ReplicatedStorage.Event:FireServer(script.Parent, script.Parent.Check.Value)
    end
end)
--server--
game.ReplicatedStorage.Event.OnServerEvent:Connect(function(player, Button, Check)
    if Check == true then
        Buttoon.BackgroundColo3 = Color3.fromRGB(30,30,30)
    end
end)

it changes the colour first time but it wont after that idk why. the gui is only local.

0
When you edit a Gui you should keep it on the client. No need for a remote event. You also has misspelled properties on line 4 of the server code block. xPolarium 1388 — 5y

1 answer

Log in to vote
2
Answered by 5 years ago

line 4 second script

Button.BackgroundColor3 = Color3.fromRGB(30,30,30)
wait()-- enter how much time to wait
Button.BackgroundColor3 = Color3.fromRGB() -- enter second color

also you need to just not use that remote event because it will not change the button color in a real game

0
alright ok. ty for this MHaven1 159 — 5y
Ad

Answer this question