this script in the server works in studio but not in game, could someone tell me why? ( its in the server script service)
local BadgeService = game:GetService("BadgeService")
local PassId = 2100404188
local players = game:GetService("Players")
local xds = game.Workspace:WaitForChild("yess")
local debounce = false
players.PlayerAdded:Connect(function(plr)
local player = game.Players:GetPlayerFromCharacter(plr.Parent)
if BadgeService:UserHasBadge(plr.UserId, PassId) then
plr.Backpack.storage.tenhourvalue.Value = 1
print("10 hour activated")
end
end)

2 comments
You should also mention UserHasBadge is broken because of the new badge updates. Tell OP to switch to UserHasBadgeAsync
Good point