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?

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

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.

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