game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if game.MarketplaceService:PlayerOwnsAsset(player,8522737) or table.find(Friends,player.UserId) then
local Humanoid = character:WaitForChild("Humanoid")
if Humanoid then
Humanoid.WalkSpeed = 21
end
end
end)
end)
No errors, No nothin’ any clue why this is happening?
Add a print before the local Humanoid line to see if it’s getting through. Before anything, do you actually own the asset with the id 8522737 or your userid is in that table?
game.Players.ChildAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, 8522737) or table.find(Friends,player.UserId) then
local h = char:WaitForChild('Humanoid')
h.WalkSpeed = 32
end
end)
end)
And you used MarketplaceService:PlayerOwnsAsset. That does’t check if you own a gamepass.
Doesn’t work because you had 2 ors, and it’s more ideal to only connect the event if they own it first to redue unneeded event connections
local mps = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
if mps:UserOwnsGamePassAsync(player.UserId, 8522737) or table.find(Friends,player.UserId) then
player.CharacterAdded:Connect(function(char)
local h = char:WaitForChild('Humanoid')
h.WalkSpeed = 21
end)
end
end)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,8522737) or table.find(Friends,player.UserId) then
wait(2)
if character.Head:FindFirstChild("DeveloperGUI") then
else
local clonedgui = billboardgui:Clone()
clonedgui.TextLabel.Text = "Premium"
clonedgui.TextLabel.TextColor3 = Color3.fromRGB(0,85,255)
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
end
end
end)
It’s basically an overhead gui for people who have the gamepass, it works fine?
I’m about to try userOwnsGamePassAsync
game.Players.PlayerAdded:Connect(function(player)
if game.MarketplaceService:PlayerOwnsAsset(player,8522737) or table.find(Friends,player.UserId) then
local Humanoid = player.Character:WaitForChild("Humanoid")
if Humanoid then
Humanoid.WalkSpeed = 21
end
end
end)
Or doing it this way;
game.Players.PlayerAdded:Connect(function(player)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 8522737) or table.find(Friends,player.UserId) then
player.Character:FindFirstChild("Humanoid").WalkSpeed = 21
end
end)
But I do have to agree with UserOwnsGamePassAsync being the way to go since it’s a GamePass