Hi all
i am making a horror game and i was working on the player dialogue but for some reason the script wouldn’t work!
Here’s the script
local Trigger = game.Workspace.HallTrigger
local textlable = script.Parent.TextLabel
local function typewrite(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.05)
end
end
Trigger.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
Trigger:Destroy()
typewrite(textlable,"what?")
wait(2)
typewrite(textlable,"They din't even unpack...")
wait(3)
typewrite(textlable,"must have left in a hurry")
wait(4)
textlable.Visible = false
end
end)
btw there is another local script in the same screen gui

This is the other script and also the one that works
local Trigger = game.Workspace.Entry
local textlable = script.Parent.TextLabel
local function typewrite(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.05)
end
end
Trigger.Touched:Connect(function()
Trigger:Destroy()
typewrite(textlable,"Hey everybody i am home!")
wait(3)
typewrite(textlable,"Huh?")
wait(1)
typewrite(textlable,"Any one home?")
wait(4)
typewrite(textlable,"I guess they must have gone out")
wait(4)
textlable.Visible = false
end)