I have this localscript that's supposed to:
- Wait for the StringValue "Current" to change
- Delete all the letters of the text box it's a child of one by one
- Retype them
- Wait until a change has been made
local Shop = script.Parent.Parent
local Bar = script.Parent
local Current = Shop.Current
while true do
--local Text = Current.Value
--local NewText = Text
if NewText == "" then
local Text = "Select Item"
local NewText = Text
print (NewText)
end
if Current.Value == "GFL" then
NewText = "Golden Flashlight"
end
if Current.Value == "SPB" then
NewText = "Sprint Boost"
end
if Current.Value == "SMA" then
NewText = "Stamina Boost"
end
while Bar.Text == NewText do
if Current.Value == "GFL" then
NewText = "Golden Flashlight"
end
if Current.Value == "SPB" then
NewText = "Sprint Boost"
end
if Current.Value == "SMA" then
NewText = "Stamina Boost"
end
wait()
end
local times = Bar.Text:len()
local Text = NewText
for count = 1, times do
Text = (string.match(Bar.Text, "$"))
wait(0.05)
Bar.Text = Text
end
if NewText == nil then
local Text = "Select Item"
local NewText = Text
print (NewText)
end
print(NewText)
local times = NewText:len()
--for i, letter in pairs(string.split(NewText,"")) do
-- Bar.Text = Bar.Text..""..letter
-- local Text = Text..""..letter
-- wait(0.05)
-- end
wait()
end
I'm sure the answers obvious, but the output at line 44 reads as "Select Item," but line 46 reads Nil. Is there something affecting it between the two?? Please help Edit: The comment part at the bottom is the part that deletes the old text one by one
