Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

5 comments

0

I think else if not is not needed. Just do else.

0

I'll try this :)

0

no elseifis not needed, all that is needed is else return end

0

Used the script SunxLightz suggested and got the error "W001: Unknown global 'Player'." How should I correctly define Player?

0

change Player to p

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)

1 comment

0

another problem! This only works in studio and I don't know why...

This discussion is preserved as it was. New answers, comments, and votes are closed.