Hello, please can you help me with my script, the goal is simple: 2 teams, a red team, a blue team, each team contains 4 players, a timer, once the timer has started the game begins, I I would like that when the game starts, there is an object that appears in the inventory of one of these 8 players, (only 1 person) and the goal is to pass this object to any person in order to avoid it as much as possible, before it explodes, if the object explodes on the person carrying it, the person dies.
I still tried to do something on my side. I went to see the api but there is nothing that matches my searchs.
local Players = game:GetService("Players")
local timerEnd = 20
local timePassed = 0
local Part1 = workspace.REDTEAM
local Part2 = workspace.BLUETEAM
local Tool = game.ServerStorage.EQUI
local function timer()
timePassed = 0
while true do
task.wait(1)
timePassed += 1
if timePassed == timerEnd then
Part1.Transparency = 1
Part2.Transparency = 1
Part1.CanCollide = false
Part2.CanCollide = false
local player = Players:GetPlayerFromCharacter()
local backpack = player.Backpack
Tool:Clone().Parent = backpack
break
end
end
end
Part1.Touched:Connect(function()
timer()
print(timePassed)
end)