Hello,
I get this Error message when i should get a badge: “Sorry, badges can only be awarded by Roblox game servers” and I wont get the badge because of it. All the other badges worked but only this specific one doesn’t. Does anyone know what it means?
Here is the code if it matters:
local Player=game.Players.LocalPlayer
script.Parent.Activated:Connect(function(player)
if script.Parent.Name == "CheeseBurger" then
wait(5)
local BadgeService = game:GetService("BadgeService")
local BadgeId = 2153649067
BadgeService:AwardBadge(Player.UserId, BadgeId)
Player.PlayerGui.MoneyGUI:Destroy()
Player.PlayerGui.ChezburgurEnding.Enabled = true
script.Parent:Destroy()
end
end)
Looks like it was made in a LocalScript like @optimizedcoder said. What you can do is use remotes depending on what is used.
Remotes will help Local Scripts and Server Scripts communicate with each other. Add one with the name of your choice, and make the server script be able to detect when it is called.
In the script you seem to have two variables that reference to a player, one called “Player” and another one called “player” which you get from the script.Parent.Activated event, just reference that player instead and switch to a server script.