script.Parent.MouseButton1Click:Connect(function()
if game.player.localplayer.leaderstats.kills >= 10 then do
script.Parent.Parent.SCAR:Clone.Parent = game.Players.LocalPlayer.backpack
)
✓ ANSWER ACCEPTED
how would i fix a script that gives u a gun after 10 kills?
2 answers
✓ Accepted answer
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^
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
the formatting e.e
also explain what you fixed and why they need to be fixed so he can learn from his mistake
cant be bothered right now, rather be reported or something, but i understand that you know what i fixed so why dont you explain
This isnt that good because youd have to add 10 to the cap after every time he reaches 10s value