local Players = game:GetService("Players") local Bird = script.Parent:WaitForChild("Humanoid") local BadgeService = game:GetService("BadgeService") local BadgeID = 0 --I haven't made a badge yet while true do if Bird.Died then local players = game:GetService("Players"):GetPlayers() BadgeService:AwardBadge(players.UserID, BadgeID) end end
When I run this script it says: Argument 1 missing or nil - Server - Script:10 Stack Begin - Studio Script 'Workspace.FenceDimorphodon.Script', Line 10 - Studio - Script:10 Stack End - Studio
Why is it saying that? I'd really appreciate anyone who can help me!
in line 9
local players = game:GetService("Players"):GetPlayers()
you get a table with all the players so in line 10
BadgeService:AwardBadge(players.UserID, BadgeID)
you ask for a specific userID from a table that contains all Players, you don't specify which user you want to get the id from
if you want to give the badge to all players you do
for _, player in pairs(players) do BadgeService:AwardBadge(player.UserID, BadgeID) end