01 | kills = game.Workspace.LeaderboardV 3. leaderstats.KOs |
02 |
03 | script.Parent.ClickDetector.MouseClick:connect( function (Buy) |
04 | if kills > = 0 then |
05 | for i,v in pairs (game.Players:GetChildren()) do |
06 | if v.Backpack ~ = nil then |
07 | clone 2 = game.Lighting.Venomshank:Clone() |
08 | clone 2. Parent = v.Backpack |
09 | end |
10 | end |
11 | end |
12 | end ) |
This is what you did wrong: in the first line you defined kills as the leaderstat in the player. So you are basically saying that if the leaderstat kills = 0 then you get it. You get the sword. You want to define the value. So then you will be saying if the player has 0 kills then buy the sword.
1 | kills = game.Workspace.LeaderboardV 3. leaderstats.KOs.Value |
So this would be the script:
01 | kills = game.Workspace.LeaderboardV 3. leaderstats.KOs.Value |
02 |
03 | script.Parent.ClickDetector.MouseClick:connect( function (Buy) |
04 | if kills > = 0 then |
05 | for i,v in pairs (game.Players:GetChildren()) do |
06 | if v.Backpack ~ = nil then |
07 | clone 2 = game.Lighting.Venomshank:Clone() |
08 | clone 2. Parent = v.Backpack |
09 | end |
10 | end |
11 | end |
12 | end ) |