Kick player out of seat if they don't have a gamepass

For some reason I can’t kick the player out of a seat if they don’t have a gamepass

I am using server script in the seat and it is not working

local MarketplaceService = game:GetService("MarketplaceService")

script.Parent:GetPropertyChangedSignal("Occupant"):Connect(function()

	local Occupant = script.Parent.Occupant

	if Occupant == nil then
		
		return end

	local Player = game.Players:GetPlayerFromCharacter(Occupant.Parent)

	if Player then

		if not (MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 855140482)) then
			
			task.wait(1)
			
			script.Parent.Disabled = true
			
			task.wait(3)
			
			script.Parent.Disabled = false
			
		end
	end
end)

If your method of kicking player from seat didn’t work try different one. I just googled and found this one: How can I force a player to get out of a seat

you can use either

Occupant.Sit = false 

or

Occupant.Jump = true

Both should make them jump out the seat

local MarketplaceService = game:GetService("MarketplaceService")

script.Parent:GetPropertyChangedSignal("Occupant"):Connect(function()

	local Occupant = script.Parent.Occupant

	if Occupant == nil then
		
		return end

	local Player = game.Players:GetPlayerFromCharacter(Occupant.Parent)

	if Player then

		if not (MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 855140482)) then
			
			task.wait(1)
			
			script.Parent.Disabled = true
			
			task.wait(3)
			
			script.Parent.Disabled = false
			
		end
	end
end)

Ok so what I did was I made a gamepass and used that gamepass Id which didn’t work because I already had the gamepass

So my original code actually works but you can also do what @TheYusufGamer said

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.