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)
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