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

Gold and EXP will only stay at 10 and not go anything past 10?

Asked by 7 years ago
Edited 7 years ago

when you kill a mob in the rpg, it gives 5 gold and 5 xp but no matter how many times you kill something or how much xp and gold you get, it will not go past 10. please help here is the script

01local datastore = game:GetService("DataStoreService"):GetDataStore("MyRPGDataStore") --Call "GameStore" whatever you like
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...
1
Show us the code that awards gold & exp, this code is fine. TheDeadlyPanther 2460 — 7y
0
I used to have the same problem, Try redoing the order you put the Xp's Values in, Example: Instead of Value,MaxValue,MinValue try MaxValue,MinValue,Value This might not work but it's worth a shot :/ starblasto 43 — 7y
0
leaderstats is supposed to be a model, not an IntValue. cabbler 1942 — 7y

Answer this question