#Help with script (Prob an easy bug I'm too dumb to fix)

38 messages · Page 1 of 1 (latest)

wintry adder
#

I was patching up the script when I got this error: Text is not a valid member of Localscript. I have no idea what is wrong since I did nothing to the variable or that part of the script. Here is the script so it makes way more sense. ``local timergui = script.Parent
local timertext = script.Parent.Timer
local secondtimertext = script.Parent["2nd Timer"]
local replicatedstorage = game:GetService("ReplicatedStorage")
local variable = replicatedstorage.Timer
local roundEnded = replicatedstorage.RoundEnding

-- Initialize roundEnded and variable values
roundEnded.Value = false
variable.Value = 180

-- Enter the game loop
while game.Workspace do

-- Check if the round has ended
if variable.Value == 0 and not roundEnded.Value then
    print("Round Ended") 
    roundEnded.Value = true
    timertext.Text = "Round Ended"
    
elseif not roundEnded.Value then
    -- Update the timer display and decrement the timer
    print("work")
    timergui.Timer.Text = variable.Value
    wait(1)

    variable.Value = variable.Value -1
end
wait(0)

end``
By the way the error only occurs when I click play in the output.

#

man

#

wat

#

Text is not a valid member of LocalScript "Players.score092.PlayerGui.Timer Gui.Timer"

#

im trying to get the property text

#

it thinks im getting the child text

#

how do i format it btw

#

u saw nothing

#

yes

#

the line of the eror is 25

#

" timergui.Timer.Text = variable.Value"

#

dies

#

the script is dump

#

at top

#

also i have no idea where the script.parent came from itsnot actually in the script

rancid turret
#

Text is not a valid member of LocalScript "Players.score092.PlayerGui.Timer Gui.Timer"

It's saying there's no Text property or Child to the LocalScript

#

LocalScripts don't have that property

wintry adder
#

it worked before

#

also it works on line 20

honest coralBOT
#

studio** You are now Level 4! **studio

rancid turret
#

timergui.Text maybe?

wintry adder
#

ignore the overexposed quality if u dont have hdr monitor

rancid turret
#

Rename that thing man..

wintry adder
#

lool

rancid turret
#

It's finding the LocalScript first because it's first in the hierarchy

wintry adder
#

IM SO DUMB

#

F### ME

rancid turret
#

Nah, it's simple mistake lol.

wintry adder
#

yea

rancid turret
#

You're working on something that involves many moving parts. You're doing fine my man.

wintry adder
#

ok

#

yeaaa

#

i have another thing i might need help with

#

i had another one that was putting text at the end of subtracting a variable

#

but no one responded

#

"Hey I'm trying to add text after subtracting a variable but I can't put quotations at the end"

#

"Here is the code
variable.Value = variable.Value -1"