Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

LocalPlayer cannot change a value inside the player?

button = script.Parent
player = game.Players.LocalPlayer

button.MouseButton1Click:connect(function()
	if button.Text == "Not ready" then
		button.Text = "Ready"
		player.ready.Value = true
	elseif button.Text == "Ready" then
		button.Text = "Not ready"
		player.ready.Value = false
	end
end)

  • Localscript inside a button in startergui
  • Works fine in studio play, not in local/real servers
  • It changes the text, but not the value

rip

2 comments

0

Is FE enabled?

0

yup

1 answer

✓ Accepted answer

The issue is that you have filtering enabled turned on. A simple solution to fixing this issue is by doing this

Inside the localscript at ur button

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)

then have a remote event called ready inside of ur replicatedstorage. Then use a script inside of ServerScriptService with this code

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

If this helped then tag this as answered. If you get any errors comment on this and ill try to help :D

1 comment

0

Thx dude :D

This discussion is preserved as it was. New answers, comments, and votes are closed.