Hello there developers! I have an obstacle and I need to rely on you guys for some help. You see, I have a script where you interact with a proximity prompt and it gives dialogue. However, I see to be getting a weird error which says attempt to get length of a nil value
and I’m not sure why. If you guys could tell me what’s wrong, it would be much appreciated. Thank you!
Script From Prompt:
script.Parent.robothelpprompt.Triggered:Connect(function(player)
script.Parent.robothelpprompt.Enabled = false
local text = "WHAT SHALL I ASSIST WITH?"
local rs = game:GetService("ReplicatedStorage")
rs.Robotinteract:FireAllClients()
rs.Robotinteract:FireClient(player,"EXPERIMENT 404",text,"0, 0.00784314, 0.505882")
end)
Local Script For DIalogue Frame:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local scriptParent = script.Parent
local function soundPlay()
local sound = script["dialog beep"]:Clone()
sound.Parent = scriptParent
sound.Name = "dialog"
sound:Play()
wait(1)
sound:Remove()
end
-- event
ReplicatedStorage.Robotinteract.OnClientEvent:Connect(function(name, text, color)
scriptParent.Visible = true
scriptParent.npcName.Text = "EXPERIMENT 404"
scriptParent.npcName.TextColor3 = Color3.new(0, 0.00784314, 0.505882)
for i = 1, #text do -- heres the error
scriptParent.npcText.Text = string.sub(text,1,i)
coroutine.wrap(soundPlay)()
wait(0.04)
end
wait(1.75)
script.Parent.Wage.Visible = true
script.Parent.Israel.Visible = true
script.Parent["Job History"].Visible = true
end)