JumpPower is not changing upon joining?
I tried putting this in a LocalScript in backpack, screengui, starterplayer/character scripts folder, then in a regular script in serverscriptservice, nothing works.
When in LocalScript, I define player as LocalPlayer, in regular script, I define player in the PlayerAdded function.
It is printing the correct numberValue, there's no errors. But it won't update the JumpPower, it remains at 50.
Here's the code:
01 | game.Players.PlayerAdded:Connect( function (player) |
03 | local Saves = player:WaitForChild( "Saves" ) |
04 | local char = player.Character |
05 | local human = char:WaitForChild( "Humanoid" ) |
06 | local JumpPower = human.JumpPower |
09 | bools.jump 1 = Saves:WaitForChild( "jump1" ) |
10 | bools.jump 2 = Saves:WaitForChild( "jump2" ) |
11 | bools.jump 3 = Saves:WaitForChild( "jump3" ) |
12 | bools.jump 4 = Saves:WaitForChild( "jump4" ) |
13 | bools.jump 5 = Saves:WaitForChild( "jump5" ) |
14 | bools.jump 6 = Saves:WaitForChild( "jump6" ) |
15 | bools.jump 7 = Saves:WaitForChild( "jump7" ) |
16 | bools.jump 8 = Saves:WaitForChild( "jump8" ) |
17 | bools.jump 9 = Saves:WaitForChild( "jump9" ) |
18 | bools.jump 10 = Saves:WaitForChild( "jump10" ) |
21 | buttons.jump 1 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 1 |
22 | buttons.jump 2 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 2 |
23 | buttons.jump 3 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 3 |
24 | buttons.jump 4 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 4 |
25 | buttons.jump 5 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 5 |
26 | buttons.jump 6 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 6 |
27 | buttons.jump 7 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 7 |
28 | buttons.jump 8 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 8 |
29 | buttons.jump 9 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 9 |
30 | buttons.jump 10 = player.PlayerGui.main.shopFrame.skillsScrolling.jump 10 |
32 | if bools.jump 1. Value = = true then |
33 | buttons.jump 1. Text = "+1%Jump" |
34 | buttons.jump 1. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
35 | script.jump 1. Value = 0.5 |
38 | if bools.jump 2. Value = = true then |
39 | buttons.jump 2. Text = "+2%Jump" |
40 | buttons.jump 2. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
41 | script.jump 2. Value = 1 |
44 | if bools.jump 3. Value = = true then |
45 | buttons.jump 3. Text = "+3%Jump" |
46 | buttons.jump 3. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
47 | script.jump 3. Value = 1.5 |
50 | if bools.jump 4. Value = = true then |
51 | buttons.jump 4. Text = "+4%Jump" |
52 | buttons.jump 4. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
53 | script.jump 4. Value = 2 |
56 | if bools.jump 5. Value = = true then |
57 | buttons.jump 5. Text = "+5%Jump" |
58 | buttons.jump 5. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
59 | script.jump 5. Value = 2.5 |
62 | if bools.jump 6. Value = = true then |
63 | buttons.jump 6. Text = "+6%Jump" |
64 | buttons.jump 6. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
65 | script.jump 6. Value = 3 |
68 | if bools.jump 7. Value = = true then |
69 | buttons.jump 7. Text = "+7%Jump" |
70 | buttons.jump 7. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
71 | script.jump 7. Value = 3.5 |
74 | if bools.jump 8. Value = = true then |
75 | buttons.jump 8. Text = "+8%Jump" |
76 | buttons.jump 8. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
77 | script.jump 8. Value = 4 |
80 | if bools.jump 9. Value = = true then |
81 | buttons.jump 9. Text = "+9%Jump" |
82 | buttons.jump 9. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
83 | script.jump 9. Value = 4.5 |
86 | if bools.jump 10. Value = = true then |
87 | buttons.jump 10. Text = "+10%Jump" |
88 | buttons.jump 10. BackgroundColor 3 = Color 3. new( 85 , 170 , 255 ) |
89 | script.jump 10. Value = 5 |
92 | JumpPower = 50 + script.jump 1. Value + script.jump 2. Value + script.jump 3. Value + script.jump 4. Value + script.jump 5. Value + script.jump 6. Value + script.jump 7. Value + script.jump 8. Value + script.jump 9. Value + script.jump 10. Value |