Hi!
I want that when player touched the part, player will get kicked after 15 seconds.
Script:
function onTouch(hit)
if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then
local char = game.Players:FindFirstChild(hit.Parent.Name)
wait(15)
char:Kick("YOU ESCAPED :D - tutab9")
end
end
script.Parent.Touched:Connect(onTouch)
But it doesn’t work when I type “wait(15)” into script.
To be honest I don’t know how can I use the wait command with that script:/
Can you help me please(●’◡’●)
local function onTouch(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player then
task.wait(10)
player:Kick("YOU ESCAPED :D - tutab9")
end
end
script.Parent.Touched:Connect(onTouch)