I try to make game like the oldes arsenal but when i try to make random tool for kill script nothing work in code. I try to find script in web but nobody publish script. Please help !

edit: Here is a script:

local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Folder = RS:WaitForChild("GUNS")

local function onCharacterAdded(character)
	local Tools = Folder:GetChildren()
	local ToolsTable = Tools
	local chosenTools = {}

	repeat
		local selectedIndex = math.random(1, #ToolsTable)
		table.insert(chosenTools, ToolsTable[selectedIndex])
		table.remove(ToolsTable, selectedIndex)
	until #chosenTools >= 1

	local plr = Players:GetPlayerFromCharacter(character)
	for i,v in pairs(chosenTools) do
		Folder:FindFirstChild(v.Name):Clone().Parent = plr.Backpack
	end
end

local function onAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end

Players.PlayerAdded:Connect(onAdded)

I can't show the edited version because I haven't saved the changes

6 comments

1

What do you mean by random to for kill script, please exain more as to what it is supposed to do

0

When you kill someone with frist tool, you get other tool but frist has been removed.

0

Same as in the arsenal

0

oh

0

Hey, Maybe Try to post the script that you have done so far? As This is Scripting Helpers, We will help you with the script that you currently Have!

0

It appears that you are new to our website. Please review our community guidelines using the following link: https://scriptinghelpers.org/help/community-guidelines