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

Why am I getting "Ready is not a valid member of Player" error?

Asked by
JipSea 23
4 years ago

Hello! I have a GUI where a player can click "READY" or "NOT READY" and if they click READY it will fire an event called Ready in Replicated Storage.

I am receiving the error "Ready is not a valid member of Player" error. Please help!

Local Script inside TextButton: (StarterGui)

button = script.Parent
player = game.Players.LocalPlayer
button.MouseButton1Click:connect(function()
    if button.Text == "Not ready" then
        button.Text = "Ready"
        game.ReplicatedStorage.Ready:FireServer()
    elseif button.Text == "Ready" then
        button.Text = "Not ready"
        player.Ready.Value = false
    end
end)

Script inside "ServerScriptStorage"

game.ReplicatedStorage.Ready.OnServerEvent:Connect(function(player)
game.Players[player.Name].Ready.Value = true
end)

And my remote event is inside "Replicated Storage" called "Ready"

Thanks!

0
I see, you will need a :WaitForChild I'm afraid... NIMI5Q -2 — 4y
0
And try to make 'connect' in localsctipt uppercase too Lazarix9 245 — 4y
0
^ NIMI5Q -2 — 4y
0
does the player acutally have a value called ready directly inside of their Players[roblox name] folder? Nickiel13 58 — 4y
0
Do you know where I would add the WaitForChild? JipSea 23 — 4y

Answer this question