added the characteradded function to make it permanent, but it still refuses to work?
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamePassID = 836664
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character) --this will fire every time a player's character spawns
character:WaitForChild("Humanoid")
onPlayerAdded(player)
local hasPass = false
-- Check if the player already owns the game pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player has pass: " .. tostring(message))
return
end
if hasPass == true then
print(player.Name .. " owns the game pass with ID " .. gamePassID)
player.Character.Humanoid.WalkSpeed = 30
end
end)
end)
game:GetService('Players').PlayerAdded:Connect(onPlayerAdded)

2 comments
Erm, not sure if it'll help but it seems that you have indented your 'CharacterAdded' function too much.
Forgot local player soo