Ok, so, I’ve been making a game, and for some reason, One singular badge will not award.
I a currently waiting for a player to click a textbutton on a LocalScript, and then running a server event on a RemoteEvent.
Here are my scripts:
- Local:
function Roller()
for _, Chance in pairs(Items) do
Weight += (Chance * 10)
end
local ranNumber = math.random(1, Weight)
Weight = 0
for Prize, Chance in pairs(Items) do
Weight += (Chance * 10)
if Weight >= ranNumber then
if hideprint == false then
print(Prize.." was won")
end
local Clone = script.Rolling:Clone()
Clone.Parent = script.Parent
Clone.Text = "Rolling..."
wait(2)
Clone.Text = "You got: "..tostring(Prize)
wait(1)
Clone:Destroy()
WordsSF:WaitForChild(Prize).TextColor = BrickColor.new("Lime green")
game.ReplicatedStorage.Badge:FireServer(6433767682) -- The RemoteEvent
break
end
end
end
It’s a simple chance system, but when you roll for the first time, it is met to give a badge.
Next, there is a script in ServerScriptService:
game.ReplicatedStorage.Badge.OnServerEvent:Connect(function(Plr, Id)
print("Badge")
game:GetService("BadgeService"):AwardBadge(Plr.UserId, Id)
end)
I am certain that the remote event is working, seeing as in the output I get:
Badge
But nothing else there are no errors… and no badge.