So far I got this, but I want it to repass to the last person, any ideas?
local Module = require(game.Workspace.ActiveMaps.BombPass.Buttons:WaitForChild('MainService'))
local Debounce = false
script.Parent.Parent.HumanoidRootPart.Touched:Connect(function(Hit)
if Debounce then
return
end
if Hit.Parent:FindFirstChild("Humanoid") then
Debounce = true
local Character = Hit.Parent
local Player = game:GetService("Players"):GetPlayerFromCharacter(Character)
local CurrentBombUser = Module:GetBombUser(false)
if CurrentBombUser ~= Player.UserId then
if not Character:FindFirstChild("Humanoid") or Character.Humanoid.Health <= 0 then
return
end
Module:SetBombUser(tonumber(Player.UserId), script.Parent, Character)
end
wait(1.5)
Debounce = false
end
end)
Module:
function ServerModule:GetBombUser(GetLatest)
if not GetLatest then
return CurrentBombHolder
else
return LastBombHolder
end
end
function ServerModule:SetBombUser(UserId, InstanceHat, Character)
if UserId ~= nil then
if UserId ~= CurrentBombHolder then
CurrentBombHolder = UserId
InstanceHat.Parent = Character
end
end
end
I couldn’t figure it out.
just let me know and I’ll see if I can get same results for you too!