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

how do i define the player in a script? not local

Asked by 4 years ago

not local

local function click(player)
    game.Workspace.Countdown.BrickColor = BrickColor.new("New Yeller")
    player.Character.Head.Anchored = true

    wait(10)

    game.Workspace.Countdown.BrickColor = BrickColor.new("Lime green")
    player.Character.Head.Anchored = false
    while true do
        script.Player.PlayerGui.Tasksbar.t2.BackgroundColor3 = Color3.new("Lime Green")
    end
end

workspace.Task1.ClickDetector.mouseClick:connect(click)
0
is the script returning any errors? you should make the "while true do" statement "while wait() do" sergeant_ranger 184 — 4y
0
i said the error, it doesnt work IIPedroI -3 — 4y

1 answer

Log in to vote
0
Answered by
rabbi99 714 Moderation Voter
4 years ago

It's not possible to change GUI's in a serverscript. Instead, make a RemoteEvent and FireClient(player) and make a localscript to change the GUI.

0
how IIPedroI -3 — 4y
0
If you don't know how to use RemoteEvents, I recommend looking at the Developer Wiki of Roblox. It's really useful! rabbi99 714 — 4y
Ad

Answer this question