The script below only works for one player after that it does not work for anyone.I was wandering how can i fix it. chat is just a gui thats for cut scenes. Thanks in advance.
par = true
script.Parent.Touched:connect(function(hit)
if par == true then
par = false
local name = hit.Parent.Name
print(name)
local plr = game.Players:FindFirstChild(name)
local char = plr.Character
local chat = plr.PlayerGui.Chat1
local label = chat.Frame.TextLabel
chat.Enabled = true
char.Humanoid.WalkSpeed = 0
local text = "Mom: Son your late, Professor Oak is Waiting for you"
for i = 1, #text do
label.Text = string.sub(text, 1, i)
wait()
end
wait(3)
local text1 = "Ok Mom"
for i = 1, #text1 do
label.Text = string.sub(text1, 1, i)
wait()
end
wait(3)
local text2 = "Mom: Hurry your already an hour late"
for i = 1, #text2 do
label.Text = string.sub(text2, 1, i)
wait()
end
wait(3)
local text3 = "Ok I guess i got to go Now!"
for i = 1, #text3 do
label.Text = string.sub(text3, 1, i)
wait()
end
wait(3)
local text4 = "Mom: you better"
for i = 1, #text4 do
label.Text = string.sub(text4, 1, i)
wait()
end
wait(3)
chat.Enabled = false
char.Humanoid.WalkSpeed = 20
end
end)

1 comment
Man, I don't know how to fix your Lua, but please fix your grammar. It's horrendous.