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

This jump power gamepass script won't work, any ideas?

Asked by 6 years ago
Edited 6 years ago

I have code below that for some reason doesn’t seem to work for my gamepass, any ideas why it doesn’t? Thanks!

01function Close(player)
02if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479) then
03 
04game.Players.PlayerAdded:connect(function(p) -- Function P
05 
06p.CharacterAdded:connect(function(c) -- Function C
07 
08c.Humanoid.JumpPower = 200 -- [V]
09 
10end)
11 
12end)
13 
14   
15 
16else
17 
18game.Players.PlayerAdded:connect(function(p) -- Function P
19 
20end)p.CharacterAdded:connect(function(c) -- Function C
21 
22c.Humanoid.JumpPower = 50
23 
24end)
25 
26end

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
01game.Players.PlayerAdded:connect(function(p) -- Function P
02 
03p.CharacterAdded:connect(function(c) -- Function C
04if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479then
05c.Humanoid.JumpPower = 200 -- [V]
06elseif not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479then
07c.Humanoid.JumpPower =  50
08end
09end)
10 
11end)

Try this

0
I think else if not is not needed. Just do else. crowIess 5 — 6y
0
I'll try this :) hotpot888 2 — 6y
0
no elseifis not needed, all that is needed is else return end Gameplayer365247v2 1055 — 6y
0
Used the script SunxLightz suggested and got the error "W001: Unknown global 'Player'." How should I correctly define Player? hotpot888 2 — 6y
0
change Player to p SunxLightz 30 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Alright, I’ve found the answer! Here’s the script if anyone needs to use it. It seems to be working.

01game.Players.PlayerAdded:Connect(function(plr)
02 
03if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 6391479) then --Change to your gamepass id
04 
05while wait(0.5) do
06 
07plr.Character:FindFirstChild("Humanoid").JumpPower = 100 -- Change 100 to the Jump power you want, default is 50.
08 
09end
10 
11end
12 
13end)
0
another problem! This only works in studio and I don't know why... hotpot888 2 — 6y

Answer this question