I get the error ATTEMPT TO CALL NIL VALUE when trying to hand out my badge when you win?
Here is the script for the jackpot
01 | machine.SuperJPSensor.Touched:Connect( function (hit) |
02 | if hit.Name = = "Neptune_Ball" then |
03 | sounds.MonsterJackpot 2. Volume = 1 |
05 | button.Material = Enum.Material.SmoothPlastic |
07 | AwardBadge(game.Players:FindFirstChild(machine.CardReader.GameInfo.Player.Value), 2126797826 ) |
08 | machine.Particle.ParticleEmitter.Enabled = true |
09 | sounds.MonsterJackpot 2 :Play() |
11 | sounds.MonsterDropMonsterJackpotSong:Play() |
12 | ticketOut(machine.Parent.MegaJackpotScreen.Value.Value) |
13 | for i, v in pairs (game.Players:GetChildren()) do |
15 | v.PlayerGui.ScreenGui.Frame.TextLabel.Text = machine.CardReader.GameInfo.Player.Value .. " HAS WON " .. machine.Parent.MegaJackpotScreen.Value.Value .. " ON MONSTER DROP (1)" |
18 | Jpdisp.Parent.SurfaceGui.Enabled = true |
19 | for _,a in pairs (SideLights:GetChildren()) do a.SurfaceLight.Enabled = true ; a.Material = Enum.Material.Neon end |
21 | for _,a in pairs (SideLights:GetChildren()) do a.SurfaceLight.Enabled = false ; a.Material = Enum.Material.SmoothPlastic end |
22 | Jpdisp.Parent.SurfaceGui.Enabled = false |
25 | Jpdisp.Value = MegaJPDefault |
26 | for _,a in pairs (SideLights:GetChildren()) do a.SurfaceLight.Enabled = true ; a.Material = Enum.Material.Neon end |
28 | sounds.MonsterJackpot 2. Volume = i |
31 | sounds.MonsterDropMonsterJackpotSong:Stop() |
32 | machine.Particle.ParticleEmitter.Enabled = false |
33 | Jpdisp.Parent.SurfaceGui.Enabled = true |
35 | if machine.Credits.Value > 0 then button.Material = Enum.Material.Neon end |