Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can somebody help me make this script kill the non owner?

I have this but I need it to kill the player and I cant seem to make it do so.

local GamePassService = game:GetService("GamePassService")
local passId = 0000000 -- change this to your game pass ID
local vehicleSeat = script.Parent

vehicleSeat:GetPropertyChangedSignal("Occupant"):Connect(function()
    if vehicleSeat.Occupant then
        local player =
            game.Players:GetPlayerFromCharacter(vehicleSeat.Occupant.Parent)
        if player and GamePassService:PlayerHasPass(player, passId) then
            vehicleSeat.Disabled = false
        else
            vehicleSeat.Disabled = true
        end
    end
end)

3 comments

0

local player = could be a problem. You put a variable but didn't make it stand for anything.

0

It stands for the statement below, since it couldn't fit on it.

0

it detects if the player has the pass but it disables the seat permanently if the player doesnt have the pass. This is a problem I need assistance solving

1 answer

✓ Accepted answer

You should try to change the "if player" to "if player ~= nil. And also change the pass id to an real one, that might be the problem. Try it out and tell me if it works

4 comments

0

k

0

Ty

0

There's nothing wrong with "if player"; saying "if player ~= nil" only has an impact if "player" is "false" (which it won't be)

0

Is there ajything on the output?

This discussion is preserved as it was. New answers, comments, and votes are closed.