So, i'm wondering how to make it, well you know in the title. Basically someone clicks a shell and the shell gets deleted so it acts like it got collected.
This is the click to delete script.
function onClicked()
script.Parent:remove()
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Below is the badge script. How can i make it award at 10 items?
print("Badge Awarder Loaded. BadgeID: " .. script.Parent.BadgeID.Value)
-- ROBLOX scripter hackers, see what you can do with this:
-- game:GetService("BadgeService"):UserHasBadge(userid, badgeid)
function OnTouch(part)
if (part.Parent:FindFirstChild("Humanoid") ~= nil) then
local p = game.Players:GetPlayerFromCharacter(part.Parent)
if (p ~= nil) then
print("Awarding BadgeID: " ..script.Parent.BadgeID.Value .. " to UserID: " .. p.userId)
local b = game:GetService("BadgeService")
b:AwardBadge(p.userId, script.Parent.BadgeID.Value)
end
end
end
script.Parent.Touched:connect(OnTouch)
Also i just signed up.

9 comments
Create an Int variable, when the item is "deleted" or "collected" add 1 to it, in the badge script check when that variable changes, and once its at 10 award badge.
Could you post an example?
First, you have this badge in a touched script, does it need to be?
Well you click the shells and it disappears and that stands out as you collected it.
Im gonna take that as a no.
Could you like post something in answers or idk, Btw the shells are called "ShotgunShells"
There seems to be a red underline at the onClicked, line 4.
Well it seems alright now. local db = false local Collected = "Collected" -- you'll need to add in an IntValue somewhere, if you have a leaderstats script you can use that to add the "Collected" value to the player then reference it here function onClicked() if not db then -- I added a DB but may not be needed, but just in case. db = true Collected.Value = Collected.Value + 1
Doesn't seem to be working, i'm confused with the Collected =.