Why wont my script work, I keep getting error string.find unable to assign property text. string expected got nil. Any help would be appreciated. C:
Code;
local HttpService = game:GetService(“HttpService”)
local url = “REDACTED”
while true do
for _, card in pairs(script.Parent.SurfaceGui.Frame.ScrollingFrame:GetChildren()) do
card:Destroy()
end
wait(0.1)
local req = HttpService:GetAsync(url)
local jsontable = HttpService:JSONDecode(req)
for _, card in pairs(jsontable) do
if card.name == “—” then
elseif card.name == " " then
elseif card.name == "---" then
else
local clone = script.Template:Clone()
clone.Name = "Cloned"
clone.Parent = script.Parent.SurfaceGui.Frame.ScrollingFrame
if string.find(card.name, "Interview") then
clone.Template.Text = "Interviews"
elseif string.find(card.name, "Training") then
clone.Template.Text = "Trainings"
else
clone.Template.Text = string.split(card.name, " ")[3]
end
clone.Host.Text = string.split(card.name, " ")[1]
local clone2 = script.UIListLayout:Clone()
clone2.Parent = script.Parent.SurfaceGui.Frame.ScrollingFrame
clone.TimeVal.Value = card.due
end
end
wait(60)
end
[/quote]
Why wont my script work, I keep getting error string.find unable to assign property text. string expected got nil. Any help would be appreciated. C:
Code;
local HttpService = game:GetService(“HttpService”)
local url = “REDACTED”
while true do
for _, card in pairs(script.Parent.SurfaceGui.Frame.ScrollingFrame:GetChildren()) do
card:Destroy()
end
wait(0.1)
local req = HttpService:GetAsync(url)
local jsontable = HttpService:JSONDecode(req)
for _, card in pairs(jsontable) do
if card.name == “—” then
elseif card.name == " " then
elseif card.name == "---" then
else
local clone = script.Template:Clone()
clone.Name = "Cloned"
clone.Parent = script.Parent.SurfaceGui.Frame.ScrollingFrame
if string.find(card.name, "Interview") then
clone.Template.Text = "Interviews"
elseif string.find(card.name, "Training") then
clone.Template.Text = "Trainings"
else
clone.Template.Text = string.split(card.name, " ")[3]
end
clone.Host.Text = string.split(card.name, " ")[1]
local clone2 = script.UIListLayout:Clone()
clone2.Parent = script.Parent.SurfaceGui.Frame.ScrollingFrame
clone.TimeVal.Value = card.due
end
end
wait(60)
end