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

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

Asked by 7 years ago
Edited 7 years 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. Conquesias 85 — 7y
0
It stands for the statement below, since it couldn't fit on it. xEiffel 280 — 7y
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 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years 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 — 7y
0
Ty wilsonsilva007 373 — 7y
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 5873 — 7y
0
Is there ajything on the output? wilsonsilva007 373 — 7y
Ad

Answer this question