so i have a button in my server that admins can press to nuke the server.
but everyone who is in the bunker in time doesnt get kicked from the server.
i tried alot of things to detect if a player is inside a part, but cant get it to work.
can someone help me please, thanks.
this is what i have now:
local click = game.Workspace["High rank Meeting room"]["Self Destruct"]["Self Destruct Initiate"].Button.btn.ClickDetector
function Explode(player)
click.MaxActivationDistance = 0
wait(119)
wait(5)
warn("Room getting Exlploded")
local TweenService = game:GetService("TweenService")
local gui = script.Parent
local goal = {}
goal.BackgroundTransparency = 0
local tweenInfo = TweenInfo.new(
3, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = TweenService:Create(gui, tweenInfo, goal)
tween:Play()
wait(2)
local notkicked = {}
local nokickpart = game.Workspace["Blast Shelter"].NoKickPart
nokickpart.Touched:Connect(function() end)
local parts = game.Workspace["Blast Shelter"].NoKickPart:GetTouchingParts()
for _, part in next, parts do
if part.Parent:FindFirstChild("Humanoid") then
if not table.find(notkicked, part.Parent.Name) then
table.insert(notkicked, part.Parent.Name)
end
end
end
for i,v in pairs(game.Players:GetChildren()) do
if table.find(notkicked, v.Name) then
warn(v.Name .. " Survives!")
elseif not table.find(notkicked, v.Name) then
v:Kick("???")
end
end
local TweenService2 = game:GetService("TweenService")
local gui2 = script.Parent
local goal2 = {}
goal2.BackgroundTransparency = 0
local tweenInfo2 = TweenInfo.new(
3, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween2 = TweenService2:Create(gui2, tweenInfo2, goal2)
wait(2)
tween2:Play()
end
click.MouseClick:Connect(Explode)