I need it so that my lantern has a bar that slowly goes down, and when the bar is totally decreased the point light brightness will be 0 instead of 10. The player needs to touch a block so that the bar will be filled up and the light will come back on.
A lantern that need fuel?
1 answer
You could use a NumberValue to help edit the GUI
and using if and then like
if script.Parent.StringValue == 0
then
script.Parent.PointLight.Enabled = false
so insert a : Tool PointLight Part (name it Handle) script x2 fire (just for cosmetic reasons) numbervalue (name the value Oil and set the number to 100)
:: **now the GUI you can use after you get every set up also go to the roblox set called weapons drag a sword into the workspace and take the script called Local GUI and put it into the tool you put into workspace then delete the sword
the script will look like this
while wait() do
if script.Parent.Oil.Value == 0 then
script.Parent.Handle.PointLight.Enabled = false
script.Parent.Handle.Fire.Enabled = false
elseif
script.Parent.Handle.Fire.Enabled == true then
script.Parent.Handle.PointLight.Enabled = true
end
end
alright now the 2nd script you put it in the number value and then edit the script to look like this
while wait(5) do
script.Parent.Value = script.Parent.Value -1
end
and there's your basic lantern (the GUI you'll have to figure out yourself)
2 comments
Also please do accept answer if this helped you and +1 my answer :D
The pointlight and fire dont go away when the value is 0. Ill make it a model so you can look at it and tell me whats wrong.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Requests for scripts aren't allowed here. Give us what you have so far- if you haven't tried anything yet, this is the wrong place to ask.