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

I cant make this gui find the value of fuel in side the seat?

Asked by 7 years ago

while wait(3) do local Fuel = script.Parent.Parent.Parent.Fuel.Value script.Parent.Litres.Text = "" .. tostring(Fuel) end

0
use code blocks PolyyDev 214 — 7y

1 answer

Log in to vote
0
Answered by
PolyyDev 214 Moderation Voter
7 years ago
Edited 7 years ago

What you did is setting Fuel as the Int/NumberValue's value. You cannot do that in roblox lua. You must only define the object and get the value when needed. In the example you can see that I set the text to the fuels value converted into a string.

while wait(3) do 
    local Fuel = script.Parent.Parent.Parent.Fuel
    script.Parent.Litres.Text = tostring(Fuel.Value) --.." L" if you need
end

Accept if this helped

0
It still doesent work, it comes up with "08:02:05.216 - Fuel is not a valid member of PlayerGui" on output aleandroblingo -35 — 7y
Ad

Answer this question