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

Group/Gamepass Horse Somewhat Working?

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)

2 comments

0

is the script inside a seat

0

It is inside a seat

1 answer

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

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