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

How to change leaderstats with an surfaceGui for just one player?

Asked by 8 years ago

Why does this not work inside a surfaceGui? Error: Script 'Workspace.SPWN.SurfaceGui.SettingsPage1.ResetLevel.Main', Line 2

local user = game.Players.LocalPlayer
local stats = user:WaitForChild("leaderstats")

wait(5)
money = user.leaderstats.Wins
geldtwee = user.leaderstats.Trofee
price = 10

function buy()
if money.Value >= price then
money.Value = money.Value - price
geldtwee.Value = geldtwee.Value + 1
end
end
script.Parent.MouseButton1Down:connect(buy)

while true do
    wait(2)
if money.Value >= 10 then --Verander dit
    script.Parent.Text = "Trade now"
else
    if money.Value <=10 then --Verander dit
        script.Parent.Text = "Need more Wins!"  
    end
end
end

0
That doesn't appear to be the entire error... DeadToMe 105 — 8y

Answer this question