I'm making an admin panel where you can give or take away points from a player by putting their username and the amount in a text box and then it takes those inputs to set player value, but it's not taking the text. Here's the script:
script.Parent.MouseButton1Click:Connect(function() local player = script.Parent.Parent.To.Text local amount = script.Parent.Parent.Amount.Text game.Players[player].rep.Value = amount end)
that's just one of them but the rest don't work either and I'm pretty sure if I can get this one fixed I can fix them all. The text values just come back as nothing, and I proved this by putting
print(player, amount)
and it just came up as nothing and it gives the error " is not a valid member of Players". how do i fix this?
You will have to use remote events for this as textbox text is client only. Local script:
game.ReplicatedStorage.RemoteEvent:FireServer(script.Parent.Parent.TextBox.Text)
script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, text) --Text will be the textbox's text.
Hope this helped!!