script.Parent.MouseButton1Click:Connect(function() if game.player.localplayer.leaderstats.kills >= 10 then do script.Parent.Parent.SCAR:Clone.Parent = game.Players.LocalPlayer.backpack )
easy fix
script.Parent.MouseButton1Click:Connect(function() if game.Players.LocalPlayer.leaderstats.kills.Value >= 10 then script.Parent.Parent.SCAR:Clone().Parent = game.Players.LocalPlayer.Backpack end end)
this will only work if its a local script
Well you'd have to get the starting amount of kills and add ten to that.
local StartAmount = game.Players.LocalPlayer.leaderstats.kills local Cap = 10 script.Parent.MouseButton1Click:Connect(function() if game.Players.LocalPlayer.leaderstats.kills >= Cap then Cap = Cap + 10 --[[Gun Clone]].Parent = game.Players.LocalPlayer.Backpack end end)
Client Sided ONLY ^
You most likely know how to use remote events but this is a way
local StartAmount = game.Players.LocalPlayer.leaderstats.kills local Cap = 10 script.Parent.MouseButton1Click:Connect(function() if game.Players.LocalPlayer.leaderstats.kills >= Cap then GunChanger:FireEvent(game.Players.LocalPlayer.Backpack, OldGun) Cap = Cap + 10 end end)
Client Side^
KillChecker.OnServerEvent:Connect(function(Player, Backpack, OldGun) OldGun:Destroy() NewGun:Clone().Parent = Backpack end)
Server Side^