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

StringValue changed by client, server is ignoring it. Help? [Answered]

Asked by 5 years ago
Edited 5 years ago

I need to somehow get the player name to a stringvalue in ReplicatedStorage

-- Local script in StarterPlayerScripts
while true do
    wait(5)
    game.ReplicatedStorage.player.Value = game.Players.LocalPlayer.Name
    print(game.ReplicatedStorage.player.Value)
    game.ReplicatedStorage.money:FireServer()
end
-- Script in game.Workspace
game.ReplicatedStorage.money.OnServerEvent:Connect(function()
    p = game.ReplicatedStorage.player.Value
    print(game.ReplicatedStorage.player.Value)
    print(game.Players[p].leaderstats.Hidden.Wins.Value)
    if game.Players[p].leaderstats.Hidden.Wins.Value > 9 then
        game.Players[p].leaderstats.Credits.Value = game.Players[p].leaderstats.Credits.Value + 20
    else
        game.Players[p].leaderstats.Credits.Value = game.Players[p].leaderstats.Credits.Value + 10
    end
end)

The localscript changes the value, but the server is just ignoring it, and "p" is empty

0
Not how FE works, lol. You want to pass the actual changed value to the event. :FireServer(newValue) The server won't see the changed value because that doesn't get replicated back to the server. ScrewDeath 153 — 5y
0
Thanks User#23477 0 — 5y

Answer this question