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

Values dont change server side? Im a little confused?

Asked by 6 years ago

I have this script when you press a button it takes a value and gives it to you and sets the value to 0 but it doesnt do any of that. I have FE on and normally a script like this would work.

-- Button clicked events
for _, Descendant in pairs(Descendants) do
    if Descendant:IsA("ImageButton") then
        Descendant.MouseButton1Click:Connect(function()
            local InteractGui = script.Parent.Parent.InteractGui.Adornee.Parent
            local PlayerStats = ReplicatedStorage.PlayerStats
            for i = 1, PlayerStats[InteractGui.Name][Descendant.Parent.Name].Value do
                print(PlayerStats[InteractGui.Name][Descendant.Parent.Name].Value)
                PlayerStats[Player.Name][Descendant.Parent.Name].Value = PlayerStats[Player.Name][Descendant.Parent.Name].Value + 1
                PlayerStats[InteractGui.Name][Descendant.Parent.Name].Value = PlayerStats[InteractGui.Name][Descendant.Parent.Name].Value - 1
            end
        end)
    end
end

There is the code, if you have any ideas please do help :)

0
Is the code above in a local script or a server script? iishadowflames 41 — 6y
0
Its a local script GottaHaveAFunTime 218 — 6y

Answer this question