I am not sure why this isn’t working support would be appreciated as I’m new to scripting.
local BadgeService = game:GetService("BadgeService")
local TweenService = game:GetService("TweenService")
local badgeId = 2124842958
local Island = script.Parent
local debounce = false
local goal = {}
local origin = {}
origin.Position = Vector3.new(77.206, 23.756, -195.158)
goal.Position = Vector3.new(77.206, 60.812, -195.158)
local function awardBadge(player, badgeId)
-- Fetch badge information
local success, badgeInfo = pcall(function()
return BadgeService:GetBadgeInfoAsync(badgeId)
end)
if success then
-- Confirm that badge can be awarded
if badgeInfo.IsEnabled then
-- Award badge
local awarded, errorMessage = pcall(function()
BadgeService:AwardBadge(player.UserId, badgeId)
end)
if not awarded then
warn("Error while awarding badge:", errorMessage)
end
end
else
warn("Error while fetching badge info!")
end
end
function PlayerTouched(Part)
if debounce then return end
debounce = true
wait(5)
local tweenInfo = TweenInfo.new(10)
local tween = TweenService:Create(Island, tweenInfo, goal)
wait(5)
tween:Play()
awardBadge()
end
Island.Touched:connect(PlayerTouched)