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

IntValue isn't setting when created?

Asked by 4 years ago

Hello! I've been making an EXP system, with three values (1st value as Exp, 2nd one as Level and 3rd one as MaxExp) and it's not going very smoothly. Every time I test, the IntValue called "MaxExp" doesn't set to what I intended. Here's a snippit of my code of Level and MaxExp.

game.Players.PlayerAdded:Connect(function(plr)
    local leaderstats = Instance.new("IntValue",plr)
    leaderstats.Name = "leaderstats"
    local money = Instance.new("IntValue",leaderstats)
    money.Name = "Credits"
    local level = Instance.new("IntValue",leaderstats)
    level.Name = "Level"
    level.Value = 0
    local exp = Instance.new("IntValue",leaderstats)
    exp.Name = "Experience"
    local maxExp = Instance.new("IntValue",leaderstats)
    maxExp.Name = "MaxExp"
    maxExp.Value = 100 -- Not setting
end)

Any help please?

P.S, I'm new to the forum, this is my first post.

0
um I think leaderstats is supposed to be a folder and not an intvalue, if that does not work I’ll think of a way 123nabilben123 499 — 4y
0
No no, it's working fine, but the value isn't doing anything. I think it may be internet? I'm not entirely sure. Sensei_Developer 298 — 4y

2 answers

Log in to vote
0
Answered by
Robowon1 323 Moderation Voter
4 years ago

Strange, seems to work on my end. This may have to do with slow internet, slow computer, or high latency. Try connecting to ethernet.

0
Er, it doesn't work. Sensei_Developer 298 — 4y
Ad
Log in to vote
0
Answered by
0_2k 496 Moderation Voter
4 years ago

If you want this to show on a leaderboard via top right, change line 2 from "IntValue" to "Folder", but other than that it should work.

0
Nope. Doesn't work. Sensei_Developer 298 — 4y

Answer this question