Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Text is not a valid member of TextLabel???

This is the script

local PointLight = game.Workspace.Lamp.Union.PointLight
local battery = 60
local lamp = game.Workspace.Lamp.Union
local timer = script.Parent.Timer
local plr = game.Players.LocalPlayer


while true do
	wait()
	if PointLight.Enabled == true then
		battery = battery - 1
		print(battery)
		wait(1)
		
		timer.Text = battery -- i think problem is here
	end
	if battery == 50 then
		print("Lamp Break")
		lamp.PointLight:Destroy()
		lamp.Break:Play()
		lamp.Script.Disabled = true
		lamp.Material = 'Sand'
		lamp.Script.Disabled = true
		wait(0.1)
		break
	end
end

Solution is probably simple but i can't seem to find it.

1 comment

0

Error code is the title btw.

1 answer

Line 15, you wrote timer.text, Lua is case sensetive which means you have to type "Text" with a capital T in the begining.

1 comment

0

Still doesn't work

This discussion is preserved as it was. New answers, comments, and votes are closed.