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

I'm trying to script a flashlight, but it's not working. Can someone help me?

So here's what I had for my flashlight.

light = Script.Parent.Handle.SpotLight
num = 1

Mouse = game.Players.LocalPlayer:GetMouse()

function onClick()
if num == 1 then
light.Enabled = true
num = 2
else
light.Enabled = false
num = 1
end
end

Script.Parent.Equipped:connect(function()
Mouse.Button1Down:connect(onClick)
end)

I don't know how to fix this since it isn't working. Any ideas?

1 answer

✓ Accepted answer

the roblox flashlight and torch gear have similar scripts maybe you should check them out and see how they work

1 comment

0

Roblox has a flashlight? I didn't know that. Thanks!

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