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 know how to make it like, if you kill someone with a gun you get another gun.
What is the issue? Include screenshots / videos if possible!
Really not an issue.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes I have no solutions.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Guns = {
"Rifle",
"Lazer",
"Pistol"
}
local KillsTable = {}
game.Players.PlayerAdded:Connect(function()
KillsTable[player.Name] = 0
-- somehow detect when someone is killed
local Killer = --how you detect the killer
if Killer then
KillsTable[Killer.Name] += 1
local old_tool = Killer.Backpack:FindFirstChildOfClass("Tool")
if old_tool then
old_tool:Destroy()
end
local new_tool = Guns[KillsTable[Killer.Name]]
new_tool:Clone().Parent = Killer.Backpack
end
end
Please put this in #help-and-feedback:game-design-support next time. In the scripting support template, it states to not ask people to design entire systems for you.