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

A lantern that need fuel?

Asked by 10 years ago

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.

3
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. TaslemGuy 211 — 10y

1 answer

Log in to vote
4
Answered by
Prioxis 673 Moderation Voter
10 years ago

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)

1
Also please do accept answer if this helped you and +1 my answer :D Prioxis 673 — 10y
0
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. Opptitronica 0 — 10y
Ad

Answer this question