`machine.SuperJPSensor.Touched:Connect(function(hit) -- Registers the ball reaching the Mega Jackpot hole
if hit.Name == "Neptune_Ball" then
muteMusic()
local BadgeService = game:GetService("BadgeService")
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 success, result = pcall(function()
return AwardBadge(game.Players:FindFirstChild(machine.CardReader.GameInfo.Player.Value), 2126911393)
end)
if not success then
-- the AwardBadge function threw an error
warn("Error while awarding badge:", result)
elseif not result then
-- the AwardBadge function did not award a badge
warn("Failed to award badge.")
end
end
else
warn("Error while fetching badge info: " .. badgeInfo)
end
end
machine.Particle.ParticleEmitter.Enabled = true
sounds.MonsterJackpot2:Play()
wait(2)
sounds.MonsterDropMonsterJackpotSong:Play()
ticketOut(machine.MegaJackpotScreen.Value.Value)
for i = 1, 200 do
machine.MegaJackpotScreen.SurfaceGui.Enabled = true
for _,a in pairs(SideLights:GetChildren()) do a.SurfaceLight.Enabled = true; a.Material = Enum.Material.Neon end
wait(0.1)
for _,a in pairs(SideLights:GetChildren()) do a.SurfaceLight.Enabled = false; a.Material = Enum.Material.SmoothPlastic end
machine.MegaJackpotScreen.SurfaceGui.Enabled = false
wait(0.1)
end
machine.MegaJackpotScreen.Value.Value = MegaJPDefault
for _,a in pairs(SideLights:GetChildren()) do a.SurfaceLight.Enabled = true; a.Material = Enum.Material.Neon end
for i = 2, 0, -0.2 do
sounds.MonsterJackpot2.Volume = i
wait(0.1)
end
sounds.MonsterDropMonsterJackpotSong:Stop()
machine.Particle.ParticleEmitter.Enabled = false
end
end)`
game.Players:FindFirstChild(machine.CardReader.GameInfo.Player.Value is the player playing the game

3 comments
You could just use a teleport script to teleport them to a part that gives badge on touch. That would make it easier probably
That would be stupid because you get 5 plays per swipe
I have fixed my answer