I've been trying to figure out how to use a touch event badge script for a while now. I've tried multiple scripts, like this one.
local badgeID =123456789 -->Whatever your badge id is local badgeService = game:GetService("BadgeService") function onTouch(player) badgeService:AwardBadge(player.userId, badgeID) end game.Workspace.Badge.Touched:connect(onTouch)
That did not work. Do any of you know how to do this?
local badgeService = game:GetService("BadgeService") local players = game:GetService("Players") local badgeID = 000000000 function onTouch(hit) local player = players:GetPlayerFromCharacter(hit.Parent) if player then badgeService:AwardBadge(player.UserId, badgeID) end end script.Parent.Touched:Connect(onTouch)
This script is meant to be placed within the brick you want to effect Make sure to change the badgeID value to the ID of your badge, and it should work