Low Gravity gamepass not working

Hey so I am currently making a low gravity gamepass but it doesn’t work. It’s a gamepass that is supposed to give the player low gravity if they buy the gamepass. I tried placing the script in ServerScriptService.

local gamepassId = 25597491 --- gamepass of the gun
local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
	if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then
		plr.CharacterAdded:Connect(function(char)
			plr.Character.Humanoid.JumpPower = 100
			wait(1)
		end)
	end
end)

Try adding prints in between the conditioning statements and see what it prints out

local gamepassId = 25597491 
local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
    print('player added')
	if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then
        print('has gamepass')
		plr.CharacterAdded:Connect(function(char)
            print('giving effect')			
            plr.Character.Humanoid.JumpPower = 100
			wait(1)
		end)
	end
end)

Try put the CharacterAdded before the UserOwnsGamePassAsync? Like this

local gamepassId = 25597491 --- gamepass of the gun
local mps = game:GetService("MarketplaceService")

game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
	if mps:UserOwnsGamePassAsync(plr.UserId,gamepassId)then
			plr.Character.Humanoid.JumpPower = 100
			wait(1)
	end
end)
end)

try using the right gamepass

try the other

The thing is the script isnt getting executed

It’s not running at all? Where is the script positioned? What type of script is it?

You have the character with the CharacterAdded function.

Maybe, since character is already determined, replace plr.Character with char?

char.Humanoid.JumpPower = 100

Also, keep in mind it only gives you the JumpPower when the Character is added/spawned. (I’m assuming it’s after the first spawn)

A normal script in serversscriptservice

Didn’t work unfortunately, thanks for the offer

1 Like
local gamepassId = 25597491
local mps = game:GetService("MarketplaceService")
local players = game:GetService("Players")

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		if mps:UserOwnsGamePassAsync(plr.UserId, gamepassId) then
			humanoid.JumpPower = 100
			humanoid.JumpHeight = 40
		end
	end)
end)

image

1 Like

Try using pcalls. You might be getting an error you can’t see.

Why are you waiting for the humanoid inside the CharacterAdded()? Shouldn’t the humanoid already be there when the character gets added?

Worked perfectly first time, efficient as always, appreciated my guy.

Is it possible to make the attraction of the player to the ground a bit slower?

You can set workspace.Gravity locally to make a local player experience greater/lesser gravity.

https://developer.roblox.com/en-us/api-reference/property/Workspace/Gravity

Ah alright but question, imagine I use my current gamepass script :

local gamepassId = 25597491
local mps = game:GetService("MarketplaceService")
local players = game:GetService("Players")

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		if mps:UserOwnsGamePassAsync(plr.UserId, gamepassId) then
			humanoid.JumpPower = 100
			humanoid.JumpHeight = 40
		end
	end)
end)

Would I just need to put it under “humanoid.JumpHeight = 40” and say for example = ‘humanoid.Gravity.Value = 160 studs/second2’

  • How am i supposed to reference the player who bought the gamepass

  • How do i change the value of the acceleration?

The reason why it’s not firing is because the character has already been added when checking for the first time. Hence: .CharacterAdded won’t fire.