Ad
Log in to vote
0

Group/Gamepass Horse Somewhat Working?

Asked by
54013 -7
10 days ago

So I'm in a group and I am trying to make a gamepass for a horse that also works for HR's and Cavalry without them needing the game pass.

It somewhat works, it'll kill anyone who isn't a HR, has the pass, or isn't in the cavalry. However, if someone who are one of those things gets on the horse then hops off the script stops working and anyone can ride it no matter who they are.

Here's what I have:

check = false


script.Parent.Touched:connect(function(Part)
if check == false then
    local b = Part.Parent:FindFirstChild("Humanoid")
    if b ~= nil then
        local player = game.Players:GetPlayerFromCharacter(Part.Parent) 
            if game:GetService('GamePassService'):PlayerHasPass(player, 4433975) then
                print ('owns pass')

            elseif player:GetRankInGroup(3977710) >= 17 then
                print('owns pass')

            elseif player:GetRankInGroup(4100024) >= 1 then
                print('owns pass')

            elseif game:GetService('GamePassService'):PlayerHasPass(player, 4433975) then
                print ('owns pass')

            else
                Part.Parent.Humanoid.Health = 0

            end
end
    end
end)
0
is the script inside a seat sickings 641 — 10d
0
It is inside a seat 54013 -7 — 9d

1 answer

Log in to vote
0
Answered by 10 days ago

dont use gamepass service use game:GetService("MarketplaceService"):UserOwnsGamepassAsync or playerownsasset

Ad

Answer this question