#KICK from the game script

42 messages · Page 1 of 1 (latest)

zinc anchor
#

just do Kick() on touched

#
local Players = game:GetService("Players")
local Part = workspace.Part

local function onTouch(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)

if player then
player:Kick()
end
end

Part.Touched:Connect(onTouch)
#

wait

#

copy it again

#

i edited it

#

yeah cause it kicked you

#
local Players = game:GetService("Players")
local Part = workspace.Part

local function onTouch(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent)

    if player then
        player:Kick()
        script.Disabled = true
        task.wait(2)
    end
    script.Disabled = false
end

Part.Touched:Connect(onTouch)```
#

do this so it only kicks you once

#

it kicked you

#

try it in a real game

#

oh

#

it doesnt do it in roblox studio

#

you have to be in a real game

fervent crater
#

in roblox studio only warns u in the output that u have been disconnected, but doesnt do the pop-up

zinc anchor
#

yep

fervent crater
#

it's what we are telling to you

#

in the output there will be

#

like a purple warn

#

Disconnect from :: ...

#

There is no problen, that is what happen when u r kicked on studio

#

You can't do anything

#

Enable the output

#

an u should put the script.Disabled on the if player

#

if not it would disable it if theres no player and it wouldnt run the script again

#

between, is script.Enabled

#

if player then
player:Kick()
script.Enabled = false
task.wait(2)
script.Enabled = true
end

#

replace all this part

#

and then copy what i sended

#

put a end

#

u delete an end at the final of the function

#

if player then
...
end
end

empty ospreyBOT
#

studio** You are now Level 4! **studio

fervent crater
#

delete that end

#

what happen

#

between, a thing

#

in the Kick() the kick receives a parameter that is the kick message

#

u can do :Kick("You have been kicked for x")

#

needs to be in string

#

" "

fervent crater
#

make sure the script is selecting the part that u want to