How do I reference userId????
sorry, It's a really long script but it does something specific. problem is on line 5/10
local badgeID = 2124476391 local bs = game:GetService("BadgeService") local userId = Player.userId local Knock = script.Parent.Knock local a = script.Parent while true do wait(math.random(10,15)) Knock:Play() bs:AwardBadge(userId,badgeID) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.9) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 wait(.4) a.Material = "SmoothPlastic" wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.5) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 wait(.5) a.Material = "SmoothPlastic" wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.4) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 end
You just didn't put Player as a variable... I don't know if you're trying to do a touched or something but if it is a player joined then do
game.Players.PlayerAdded:Connect(function(Player) local badgeID = 2124476391 local bs = game:GetService("BadgeService") local userId = Player.userId local Knock = script.Parent.Knock local a = script.Parent while true do wait(math.random(10,15)) Knock:Play() bs:AwardBadge(userId,badgeID) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.9) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 wait(.4) a.Material = "SmoothPlastic" wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.5) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 wait(.5) a.Material = "SmoothPlastic" wait(.05) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.5 wait(.05) a.Material = "SmoothPlastic" script.Parent.SurfaceLight.Brightness = 0 wait(1.4) a.Material = "Neon" script.Parent.SurfaceLight.Brightness = 0.3 wait(.1) script.Parent.SurfaceLight.Brightness = 0.6 wait(.1) script.Parent.SurfaceLight.Brightness = 1 end end)
And if you're not doing a player added, then set a player