Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I didn't receive a badge giver. How do I get/make one that gives a badge when a part is touched?

I made some badges, and when I checked my Models the givers weren't there. Can somebody either tell me how to get them or a step by step process on how to make one because I'm really new to scripting and I need some help ._.

Seriously I don't know anything about scripting tbh

7 comments

0

Wait maybe?

0

Its been 6 hours ;-;

0

Use BadgeService, I find this service to be easy: http://wiki.roblox.com/index.php?title=API:Class/BadgeService

0

I would, but I really don't have much of an idea of how to script and I need either a copy paste script or instructions because I barely know scripting... Thanks for the suggestion though

0

I've been searching the web for quite a few hours and I can't find anything about how to make badge giver yourself without using my models, and the ones I found I didn't understand.

0

Badge givers aren't the only way to get badges. They are just the old way of giving out badges.

0

I know that, I just want something like a badge giver, basically a "Touch said Part to get badge" etc so that when you reach a certain easter egg in my game, you receive said badge. The problem is I don't understand how to make this. I would love if somebody could give me some form of instructions because I'm totally lost here

1 answer

✓ Accepted answer

Define your services. Define your badge id Define a debounce so the function doesnt run your code 100 times at once.

Award the badge if they are found in the players service http://wiki.roblox.com/index.php?title=API:Class/BadgeService/AwardBadge

Vague answer because i'm tired sorry. ):

local badgeService = game:GetService("BadgeService")
local players = game:GetService("Players")
local badgeId = 12345678
local canTouch = true

local function checkTouch(touch)
	if canTouch then
		canTouch = false
		
		local possiblePlayer = players:FindFirstChild(touch.Parent.Name)
		
		if possiblePlayer then
			badgeService:AwardBadge(possiblePlayer.UserId, badgeId)
		end

		wait(1)

		canTouch = true
	end
end

script.Parent.Touched:Connect(checkTouch)

3 comments

0

I'm so new to scripting im not familiar with what a debounce is etc but thanks for the help I guess

0

So... I need to insert a script into my part and then paste this code inside, Correct?

0

YES! SUCCESS! THANK YOU FOR THIS I SPENT HOURS SEARCHING XD Thank you so much

This discussion is preserved as it was. New answers, comments, and votes are closed.