I want to make it so if a player touches a part called Floor then they get kicked but if they own the gamepass they nothing happens.
✓ ANSWER ACCEPTED
How to make it so if a player touches a part then they get kicked?
1 answer
✓ Accepted answer
local part,debounce,gpid=workspace.VipRooms.Floor,false,1234
local Players,GamePassService=game:GetService"Players",game:GetService"GamePassService"
part.Touched:Connect(function(v)
if debounce then return end
debounce=true
local player=Players:GetPlayerFromCharacter(v.Parent)
if player and not GamePassService:PlayerHasPass(player,gpid)then
player:Kick()
end
wait(.5)
debounce=false
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
