Why won't this script change the players WalkSpeed and JumpPower?
01 | local BindableEvent 1 = game.Workspace:WaitForChild( "PointsIncrease10" ) |
02 | local BindableEvent 2 = game.Workspace:WaitForChild( "PointsIncrease30" ) |
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | local leaderstats = Instance.new( 'Model' ) |
05 | leaderstats.Name = 'leaderstats' |
06 | leaderstats.Parent = player |
07 | player.JumpPower = game.ReplicatedStorage.Points + 3 |
08 | player.WalkSpeed = game.ReplicatedStorage.Points + 3 |
09 | local JumpPower = Instance.new( 'IntValue' ) |
11 | JumpPower.Parent = leaderstats |
12 | JumpPower.Name = 'Score' |
13 | BindableEvent 1. Event:Connect( function () |
14 | JumpPower.Value = JumpPower.Value + 10 |
15 | BindableEvent 2. Event:Connect( function () |
16 | JumpPower.Value = JumpPower.Value + 30 |
17 | game.ReplicatedStorage.Points.Value = JumpPower.Value |
Error message:
Attempt to perform arithmetic on field 'Points' a userdata value
This script is meant to change the players stats depending on how many points they have.