I'm trying to make it so that when the game ends, you get experience and money, and if you have a certain amount of experience you level up. Here are the errors I'm getting:
15:53:01.492 - Experience is not a valid member of IntValue 15:53:01.492 - Script 'Workspace.lvlDealer', Line 3 15:53:01.493 - Stack End
15:53:02.499 - Points is not a valid member of IntValue 15:53:02.500 - Script 'Workspace.dealer', Line 5 15:53:02.501 - Stack End
Here is my scripts.
lvl dealer script:
game.Players.PlayerAdded:connect(function(plr) wait(5) local e = plr.leaderstats.Experience local l = plr.leaderstats.Level local ml = plr.leaderstats.Level.MaxLevel local en = plr.leaderstats.Experience.ExperienceNeeded if e.Value >= en.Value then l.Value = l.Value + 1 e.Value = e.Value - en.Value en.Value = en.Value*1.10409 end if l.Value == ml.Value then en.Value = nil end end)
dealer script:
local gt = game.Workspace.gameRunner.gameTime local Debounce = false game.Players.PlayerAdded:connect(function(plr) wait(5) local p = plr.leaderstats.Points local m = plr.leaderstats.Money local e = plr.leaderstats.Experience if gt.Value == 1 and Debounce == false then Debounce = true m.Value = m.Value + p.Value/2 e.Value = e.Value + p.Value p.Value = p.Value - p.Value wait(1) Debounce = false end end)
Thank you! It would be great if somebody could answer this :)
You have to create the values before you can use them.