Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

(ANSWERED) How do I give a character torso a pointlight?

My game uses dynamic lighting, and I don't understand how to give the character a pointlight on their torso.

Any help?

Thanks, FamousDoge

1 answer

✓ Accepted answer
local mouse = game.Players.LocalPlayer:GetMouse()
function Light()
	player = game.Players.LocalPlayer
	playerChar = player.Character
	playerLight = playerChar.Torso:FindFirstChild("Light")
	if playerLight then
		playerLight:Destroy()
	else
		light = Instance.new("SpotLight",playerChar:FindFirstChild("Torso"))
		light.Name = "Light"
	end
end
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "e" then
	Light()
end
end)

-- Put this inside of a local script

This discussion is preserved as it was. New answers, comments, and votes are closed.