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

Gold stays at 10 only and i cant find the problem?

Asked by 7 years ago
01local datastore = game:GetService("DataStoreService"):GetDataStore("MyRPGDataStore")
02 
03 
04game.Players.PlayerAdded:connect(function(player)
05    local leaderstats = Instance.new("IntValue")
06    leaderstats.Name = "leaderstats"
07    leaderstats.Parent = player
08 
09    local xd = Instance.new("IntConstrainedValue")
10    xd.Name = "Level"
11    xd.Parent = leaderstats
12    xd.Value = 1
13    xd.MaxValue = workspace:FindFirstChild("GameSettings").MaxLevel.Value
14    xd.MinValue = 0
15 
View all 55 lines...
0
Please tell us the issue, and the indicated error/ problem (show where the problem lies); can't help with a lack of information. :/ TheeDeathCaster 2368 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Gold part is Line 23 to Line 28.

I see the errors on Line 27 and 28

1"xd.MaxValue = workspace:FindFirstChild("GameSettings").MaxGold.Value"

and

1"xd.MinValue = 0"

xd is a local of Level is xd (See on Line 9) -

1local xd = Instance.new("IntConstrainedValue")

The local of Gold is ss (See on Line 23) -

1local ss = Instance.new("IntConstrainedValue")

You need to change the local value of Level to local value of Gold on Line 27 and 28

1xd.MaxValue = workspace:FindFirstChild("GameSettings").MaxGold.Value
2xd.MinValue = 0

To

1ss.MaxValue = workspace:FindFirstChild("GameSettings").MaxGold.Value
2ss.MinValue = 0

Don't forget upvote me :)

Ad

Answer this question