If you can answer this it would be really helpful if you included a script.
01 | function playerAdded(plr) |
02 |
03 | local stats = Instance.new( "IntValue" , plr) |
04 | stats.Name = "leaderstats" |
05 |
06 | local money = Instance.new( "IntValue" , stats) |
07 | money.Name = "Jump Power" |
08 | money.Value = game.Players.plr.Character.Humanoid.JumpPower |
09 |
10 | end |
11 |
12 | game.Players.PlayerAdded:connect(playerAdded) |
Hello, jalbraek!
Try this:
01 | function playerAdded(plr) |
02 |
03 | repeat wait() until plr.Character --Waits for player character |
04 |
05 | local stats = Instance.new( "Folder" ) --Leaderstats is a folder, not a IntValue and the Parent property of the Instance.new is deprecated.. you should not use it |
06 | stats.Name = "leaderstats" |
07 | stats.Parent = plr |
08 |
09 | local money = Instance.new( "IntValue" ) -- The parent property of the Instance.new is deprecated.. you should not use it |
10 | money.Name = "Jump Power" |
11 | money.Value = plr.Character.Humanoid.JumpPower |
12 | money.Parent = stats |
13 |
14 | plr.Character.Humanoid.Changed:Connect( function () --Makes it update on changed |
15 | money.Value = plr.Character.Humanoid.JumpPower |
16 | end ) |
17 |
18 | end |
19 |
20 | game.Players.PlayerAdded:connect(playerAdded) |
Note: Don't post duplicate questions!
Good Luck with your games
Hi!
You seem to be using a lot of deprecated functions, such as
Instance.new("IntValue", plr)
. You should use: local int = Instance.new("IntValue")
int.Parent = plr
. Same goes for stats and connect (should be Connect
, with the capital C)
Anyways, try this:
01 | function playerAdded(plr) |
02 |
03 | local stats = Instance.new( "IntValue" ) |
04 | stats.Parent = plr |
05 | stats.Name = "leaderstats" |
06 |
07 | local money = Instance.new( "IntValue" ) |
08 | money.Parent = stats |
09 | money.Name = "Jump Power" |
10 | money.Value = game.Workspace:WaitForChild(plr.Name).Humanoid.JumpPower |
11 |
12 | end |
13 |
14 | game.Players.PlayerAdded:Connect(playerAdded) |
I hope this helped!
Marked as Duplicate by Leamir, AswormeDorijan111, xPolarium, and User#19524
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?