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)
dont use gamepass service use game:GetService("MarketplaceService"):UserOwnsGamepassAsync or playerownsasset