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

Would this gamepass script work?

trying to make a gamepass script where on respawn you have extra jump height(less gravity) wondering if this would turn out well, and if it doesnt, could someone help?

GPS = Game:GetService("GamePassService")
gpid = 167996406

function respawned(char)
player = game.Players:FindFirstChild(char.Name)
if char:FindFirstChild("Head") ~= nil then
if GPS:PlayerHasPass(player, gpid) then
print("Payer has pass.")
repeat
wait(1)
G = Instance.new("BodyForce")
G.force = Vector3.new(0,2000,0)
G.Parent = game.Players.char.Torso
until char.Humanoid.Health==0
end
end
end
game.Workspace.ChildAdded:connect(respawned)

2 answers

Well, I got confused by the spacing a bit. I used the CharacterAdded event.

GPS = game:GetService("GamePassService")
gpid = 167996406

game.Players.PlayerAdded:connect(function(p)
	p.CharacterAdded:connect(function(char)
		if GPS:PlayerHasPass(p,id) then
			print('Player has pass')
			repeat
			wait(1)
			G = Instance.new("BodyForce")
			G.force = Vector3.new(0,2000,0)
			G.Parent = game.Players.char.Torso
			until
			char.Humanoid.Health==0
		end
	end)
end)

Test it first

1 comment

0

Yeah, I did, turns out it didn't work, like expected.

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