So I’m tryna look for tutorials on everywhere, but it seems like no one made a topic about this yet, so how do you make when you obtain a badge it gives you a tool within.
Script from Roblox -
local BadgeService = game:GetService("BadgeService")
local Players = game:GetService("Players")
local badgeID = 00000000 -- Change this to your badge ID
local function onPlayerAdded(player)
-- Check if the player has the badge
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeID)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player has badge!")
return
end
if hasBadge then
-- Handle player's badge ownership as needed
end
end
-- Connect "PlayerAdded" events to the "onPlayerAdded()" function
Players.PlayerAdded:Connect(onPlayerAdded)
Yeah but I’m talking about when you get the badge, it should give you a certain tool.
When you give them the badge, just clone the tool to their backpack
function GiveTool(Player)
local tool = game.ServerStorage.Tool:Clone()
tool.Parent = Player.Backpack
end
I don’t know how to do it, I’m not a scripter I’m sorry.
What do the players need to do in order to get the badge? Your description isn’t very specific. If we know what you’re trying to get at, we can help you better
then why dont you just hire a scripter? if not (dont want to), start at the basics of scripting yourself. Dont rush to make a game.
Anyhow, heres an article.
thats how you award badges and stuff
then you make a script that checks if they have badge, and if they do, clone the tool to their hotbar/backpack, like @StraightScared did.
Am i not right?
make sure your tool is inside serverstorage folder of game (in explorer window)
also, game explorer may be asset manager now (from the article)
I found a tutorial on youtube for how to make a badge that gives a tool here:How To Make Badge Owner Only Tools | Roblox Studio Tutorial - YouTube