I followed some individual tutorials on how to make a block give a badge on click, and how to teleport it to another game on click (if it helps the game its teleporting to is not mine) but its not working, i think at some point i managed to get it to teleport me but not give the badge but i cant remember that well ive only just picked it up
i have two cripts one for each because i didnt know how to make them both work on one script (a pebble would know more about scripting than i do)
(bottom one is the badge giver, top is teleporter)
badge giver;
local Button = game.Workspace.CubeTP -- Change YourPartName to your part which players have to click.
local Click = Button.ClickDetector
local BadgeService = game:GetService("BadgeService")
local BadgeID = 265393458345341-- Change this ID to your Badge ID
Click.MouseClick:Connect(function(player)
BadgeService:AwardBadge(player.UserId, BadgeID)
end)
teleporter
local Part = script.Parent
local CD = Part.ClickDetector
local GameId = 8835176616 -- You & Cube
CD.MouseClick:connect(function(Player)
game:GetService("TeleportService"):TeleportAsync(GameId,{Player})
end)
heres something I cooked up real quick this is for server-side but I beleive it can be on local with some tweaks:
local badgeService = game:GetService("BadgeService")
script.Parent.Touched:Connect(function(otherPart)
if game.Players:GetPlayerFromCharacter(otherPart.Parent) then
local plr = game.Players:GetPlayerFromCharacter(otherPart.Parent)
badgeService:AwardBadge(plr.UserId,badgeID) --change badgeID to desired value
end
end)
(this is a touched event so you would have to change the connection of course)
CD.MouseClick:connect(function(Player)
game:GetService("TeleportService"):TeleportAsync(GameId,{Player})
badgeService:AwardBadge(plr.UserId,badgeID) --change badgeID to desired value
end)