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