You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to achieve the arsenal feeling. example
You kill someone
You get another gun and the old one deletes it self.
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have found none.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Oh wait I see where im going with this.
Ill check if the player has a kill via leaderboard stats Kill 1
And then if it is exactly 1 it will equip another gun and ill add a variable for the old gun!
Thanks!
I’m not sure if I understood everything, but you are just trying to make in sort that if you kill someone, you get their gun and the old one you had gets deleted?
If you want to make a random gun giver script, you may wanna use the # operator to pick a random gun from a folder you should create in ReplicatedStorage.
local GunFolder = game.ReplicatedStorage:WaitForChild("Guns"):GetChildren()
local randomGun = GunFolder[math.random(1, #GunFolder)]:Clone()
This won’t work because you are trying to tell the script “If this IntValue is equal to 1”, which might seem silly, but you must add a .Value after the KillsStat to effectively tell the script “If this IntValue’s value is equal to 1”.
if KillsStat.Value == 1 then
If you are looking for whenever the value gets updated, a new gun appears, you might wanna use
KillsStat.Changed.