local BindableEvent1 = game.Workspace:WaitForChild("PointsIncrease10") local BindableEvent2 = game.Workspace:WaitForChild("PointsIncrease30") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new('Model') leaderstats.Name = 'leaderstats' leaderstats.Parent = player player.JumpPower = game.ReplicatedStorage.Points + 3 player.WalkSpeed = game.ReplicatedStorage.Points + 3 local JumpPower = Instance.new('IntValue') JumpPower.Value= 0 JumpPower.Parent=leaderstats JumpPower.Name='Score' BindableEvent1.Event:Connect(function() JumpPower.Value= JumpPower.Value + 10 BindableEvent2.Event:Connect(function() JumpPower.Value= JumpPower.Value + 30 game.ReplicatedStorage.Points.Value = JumpPower.Value end) end) end)
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.
At this line
player.JumpPower = game.ReplicatedStorage.Points + 3
you are trying to add 3 to an instance. If Points
is a Value object, then use its Value
property
player.JumpPower = game.ReplicatedStorage.Points.Value + 3
same for the other line