Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Nifer2 174
9 years ago

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

Log in to vote
1
Answered by
Azenix 1
9 years ago

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

0
Roblox has a flashlight? I didn't know that. Thanks! Nifer2 174 — 9y
Ad

Answer this question