My script to change leaderstats isn't working, this is 1 part of a big script.
Issue
1 | if plr.leaderstats.Stage > = 1 then |
2 |
3 |
4 | else |
5 | plr.leaderstats.Stage = 1 |
6 | end |
Total Script
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | script.Parent.Touched:Connect( function (hit) |
03 | if game.Players:GetPlayerFromCharacter(hit.Parent) then |
04 | if workspace:FindFirstChild( "Walls" , true ) then |
05 | local wall = workspace.Walls:FindFirstChild( "Wall4" , true ) |
06 | wall.CanCollide = true |
07 | wall.BrickColor = BrickColor.new( "Really red" ) |
08 | script.Parent.CanCollide = false |
09 | script.Parent.BrickColor = BrickColor.new( "Really red" ) |
10 | game.ReplicatedStorage.NightSky.Parent = game.Lighting |
11 | if plr.leaderstats.Stage > = 1 then |
12 |
13 |
14 | else |
15 | plr.leaderstats.Stage = 1 |
I think you forgot .Value at the end
1 | if plr.leaderstats.Stage.Value > = 1 then |
2 |
3 |
4 | else |
5 | plr.leaderstats.Stage.Value = 1 |
6 | end |
See if this works.
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | script.Parent.Touched:Connect( function (hit) |
03 | if game.Players:GetPlayerFromCharacter(hit.Parent) then |
04 | if workspace:FindFirstChild( "Walls" , true ) then |
05 | local wall = workspace.Walls:FindFirstChild( "Wall4" , true ) |
06 | wall.CanCollide = true |
07 | wall.BrickColor = BrickColor.new( "Really red" ) |
08 | script.Parent.CanCollide = false |
09 | script.Parent.BrickColor = BrickColor.new( "Really red" ) |
10 | game.ReplicatedStorage.NightSky.Parent = game.Lighting |
11 |
12 | if (plr.leaderstats.Stage.Value < = 0 ) then |
13 | plr.leaderstats.Stage.Value = 1 |
14 | else |
15 |