Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i kick a player out of a vehicle if they havent bought my gamepass?

Asked by 7 years ago
Edited by OldPalHappy 7 years ago

I would like to know how to kick a player out of a vehicle if they have not bought the gamepass. I have a script but it is not working.

local passId = 724039726 -- change this to your game pass ID.

function isAuthenticated(player) -- checks to see if the player owns your pass
    return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end

script.Parent.VehicleSeat.ChildAdded:connect(function(obj)
    if game.Players:FindFirstChild(obj.Part1.Name) then
        plr = game.Players:FindFirstChild(obj.Part1.Name)
    end

    if plr and not isAuthenticated(plr) then
        plr.Character.Humanoid.Jump = true
        print(plr.Name.." is not authorized to use this vehicle")
    end
end)
0
You could take the easy way out and ban them from your game if you have proof of them hacking mlgjay20 -7 — 7y
0
true skorpion575 0 — 7y

Answer this question