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 5 years ago
Edited 5 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!

 function Close(player)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479) then

game.Players.PlayerAdded:connect(function(p) -- Function P

p.CharacterAdded:connect(function(c) -- Function C

c.Humanoid.JumpPower = 200 -- [V]

end)

end)



else

game.Players.PlayerAdded:connect(function(p) -- Function P

end)p.CharacterAdded:connect(function(c) -- Function C

c.Humanoid.JumpPower = 50 

end)

end

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
game.Players.PlayerAdded:connect(function(p) -- Function P

p.CharacterAdded:connect(function(c) -- Function C
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479)  then
c.Humanoid.JumpPower = 200 -- [V]
elseif not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player.UserId, 6391479)  then
c.Humanoid.JumpPower =  50
end
end)

end)

Try this

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

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

game.Players.PlayerAdded:Connect(function(plr)

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 6391479) then --Change to your gamepass id

while wait(0.5) do

plr.Character:FindFirstChild("Humanoid").JumpPower = 100 -- Change 100 to the Jump power you want, default is 50.

end

end

end)
0
another problem! This only works in studio and I don't know why... hotpot888 2 — 5y

Answer this question