Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Would this gamepass script work?

Asked by 10 years ago

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?

01GPS = Game:GetService("GamePassService")
02gpid = 167996406
03 
04function respawned(char)
05player = game.Players:FindFirstChild(char.Name)
06if char:FindFirstChild("Head") ~= nil then
07if GPS:PlayerHasPass(player, gpid) then
08print("Payer has pass.")
09repeat
10wait(1)
11G = Instance.new("BodyForce")
12G.force = Vector3.new(0,2000,0)
13G.Parent = game.Players.char.Torso
14until char.Humanoid.Health==0
15end
16end
17end
18game.Workspace.ChildAdded:connect(respawned)

2 answers

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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

01GPS = game:GetService("GamePassService")
02gpid = 167996406
03 
04game.Players.PlayerAdded:connect(function(p)
05    p.CharacterAdded:connect(function(char)
06        if GPS:PlayerHasPass(p,id) then
07            print('Player has pass')
08            repeat
09            wait(1)
10            G = Instance.new("BodyForce")
11            G.force = Vector3.new(0,2000,0)
12            G.Parent = game.Players.char.Torso
13            until
14            char.Humanoid.Health==0
15        end
16    end)
17end)
Ad
Log in to vote
-1
Answered by 10 years ago

Test it first

0
Yeah, I did, turns out it didn't work, like expected. Destr0i 0 — 10y

Answer this question