--TetherBLOX local player = game.Players.LocalPlayer local character = player.Character local mouse = player:GetMouse() local brick = Instance.new('Part', character) local weld = Instance.new('Weld', brick) local light = Instance.new('SpotLight', brick) local enabled = true brick.CFrame = CFrame.new(character.Torso.Position) weld.Part0 = character.Torso weld.Part1 = brick brick.Transparency = 1 light.Angle = 180 light.Brightness = 40 mouse.KeyDown:connect(function(key) if key == 'f' and enabled then light.Enabled = false enabled = false elseif key == 'f' and not enabled then light.Enabled = true enabled = true end end)
Error: 12:06:37.016 - Players.Player3.Backpack.LocalScript:11: attempt to index local 'character' (a nil value) 12:06:37.017 - Stack Begin 12:06:37.017 - Script 'Players.Player3.Backpack.LocalScript', Line 11 12:06:37.018 - Stack End
Sometimes the script loads before the character, thus causing an Error, I add a repeat until nil
type code to prevent that;
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Torso") and game.Players.LocalPlayer:GetMouse() --This repeats waiting until the script finds/gets these requirements, until then it'll just sit there waiting before going on
Hope this helped!