aa.Touched:Connect(function()
if db == false then
db = true
plr.PlayerGui.Diyalog.yduh.Frame1.Visible = true
local mesaj = msges[math.random(1 , #msges)]
local yazilanMetin = ""
for i = 1, #mesaj do
yazilanMetin = yazilanMetin .. string.sub(mesaj, i, i)
textLabel.Text = yazilanMetin
wait()
end
end
end)
3- I tried make it normal script and local script also tried on chat gpt
local plr = game.Players.LocalPlayer
local frame1 = plr:WaitForChild("PlayerGui").Diyalog.yduh.Frame1
local db = db or false
local msges = msges or {[1]="Fix your msges variable!"}
local textLabel = textLabel or frame1:FindFirstChildOfClass("TextLabel")
aa.Touched:Connect(function()
if db == false then
db = true
frame1.Visible = true
local mesaj = msges[math.random(1 , #msges)]
local yazilanMetin = ""
for i = 1, string.len(mesaj) do
yazilanMetin = yazilanMetin .. string.sub(mesaj, i, i)
textLabel.Text = yazilanMetin
wait()
end
end
end)
local aa = game.Workspace:WaitForChild("kapi").b
local db = false
local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui.Diyalog.yduh.Frame1
local textLabel = gui:WaitForChild("TextLabel") -- TextLabel nesnesini bulun
local msges = {
"Welcome!!! , how's going",
"yo",
"What's up",
"Don't dare to steal something",
"Welcome again"
}
local function swooshSound()
local sound = Instance.new("Sound",game.ReplicatedStorage)
sound.PlaybackSpeed = 1
sound.Volume = 1
sound.PlayOnRemove = true
sound.SoundId = "rbxassetid://4845387138"
sound:Destroy()
end
aa.Touched:Connect(function()
if db == false then
db = true
plr.PlayerGui.Diyalog.yduh.Frame1.Visible = true
local mesaj = msges[math.random(1 , #msges)]
local yazilanMetin = ""
for i = 1, #mesaj do
yazilanMetin = yazilanMetin .. string.sub(mesaj, i, i)
textLabel.Text = yazilanMetin
wait()
end
end
end)
Have you create A ScreenGui named “Diyalog” inside there are a frame called “yduh” inside there are a frame called “Frame1” inside a TextLabel?
Because i have test your script it’s works me.
Tested script:
local db = false
local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui.Diyalog.yduh.Frame1
local textLabel = gui:WaitForChild("TextLabel") -- TextLabel nesnesini bulun
local msges = {
"Welcome!!! , how's going",
"yo",
"What's up",
"Don't dare to steal something",
"Welcome again"
}
local function swooshSound()
local sound = Instance.new("Sound",game.ReplicatedStorage)
sound.PlaybackSpeed = 1
sound.Volume = 1
sound.PlayOnRemove = true
sound.SoundId = "rbxassetid://4845387138"
sound:Destroy()
end
wait(1)
if db == false then
db = true
plr.PlayerGui.Diyalog.yduh.Frame1.Visible = true
local mesaj = msges[math.random(1 , #msges)]
local yazilanMetin = ""
for i = 1, #mesaj do
yazilanMetin = yazilanMetin .. string.sub(mesaj, i, i)
textLabel.Text = yazilanMetin
wait()
end
end