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
10 years ago

So here's what I had for my flashlight.

01light = Script.Parent.Handle.SpotLight
02num = 1
03 
04Mouse = game.Players.LocalPlayer:GetMouse()
05 
06function onClick()
07if num == 1 then
08light.Enabled = true
09num = 2
10else
11light.Enabled = false
12num = 1
13end
14end
15 
16Script.Parent.Equipped:connect(function()
17Mouse.Button1Down:connect(onClick)
18end)

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
10 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 — 10y
Ad

Answer this question