Ad
Log in to vote
0

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

Asked by 3 months ago
Edited 3 months ago

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)

0
local player = could be a problem. You put a variable but didn't make it stand for anything. TheCrimsonVortex 80 — 3mo
0
It stands for the statement below, since it couldn't fit on it. xEiffel 202 — 3mo
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 Farmerperson 6 — 3mo

1 answer

Log in to vote
0
Answered by 3 months ago
Edited 3 months ago

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

0
k Farmerperson 6 — 3mo
0
Ty wilsonsilva007 200 — 3mo
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) chess123mate 3668 — 3mo
0
Is there ajything on the output? wilsonsilva007 200 — 3mo
Ad

Answer this question



Ad