I am making a game called D: Revived, But I want to add a welcome badge, And I dont know how… So can somebody help me out? I will really appreciate it!
You should click on Dashboard and then select the game you are making or (upload and then selected if not uploaded to roblox)
then go Badges and make badge and then configure badge
and then make server-side script (anywhere) (in studio)
write a logic of :
just when player joins in, give the badge on based idbadge (which supposed to be “Thanks for Playing game” or what you said) and check if player has already received then don’t give the badge
Hey though, I don’t know how to script the badge giving, That’s the thing.
Roblox documentation got this
Hmm… Well. I kind of just asked help with it, Like giving me a small script to use for it. I’m not really a scripter but if I was that would be pretty nice. Still, Thank you!
It has script… you just little be modifed it
then you got that what you want
here’s the script of the roblox official docs
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local BADGE_ID = 0 -- CHANGE FOR YOUR ACTUAL BADGE ID!!!!
local function awardBadge(player, badgeId)
-- Fetch badge information
local success, badgeInfo = pcall(function()
return BadgeService:GetBadgeInfoAsync(badgeId)
end)
if success then
-- Confirm that badge can be awarded
if badgeInfo.IsEnabled then
-- Award badge
local awardSuccess, result = pcall(function()
return BadgeService:AwardBadge(player.UserId, badgeId)
end)
if not awardSuccess then
-- the AwardBadge function threw an error
warn("Error while awarding badge:", result)
elseif not result then
-- the AwardBadge function did not award a badge
warn("Failed to award badge.")
end
end
else
warn("Error while fetching badge info: " .. badgeInfo)
end
end
local function onPlayerAdded(player)
awardBadge(player, BADGE_ID)
end
Players.PlayerAdded:Connect(onPlayerAdded)
you need to make a serverscript for that, and ideally put it on serverscriptservice.
Is a serverscript basically just the normal Script? I’ve heard It’s serverside.
just the normal script, but i like to name it server, since i use a lot of client sided scripts too.
It worked, Thank you! (i have to put this since limit thing)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.