I was trying to make a gasa4 like game and I wanted a dialogue system with a typewriter effect but it’s not working and I’m not getting any errors
I have a handler script in StarterGui
heres the script
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local function soundPlay()
local sound = script.Sound:Clone()
sound.Parent = script
sound.Name = "ClonedSound"
sound:Play()
wait(1)
sound:Remove()
end
Events.Talking.OnClientEvent:Connect(function(name,text,color)
script.Parent.Visible = true
script.Parent.npcName.Text = name
script.Parent.npcName.TextColor3 = color
for i=1, #text do
script.Parent.npcText.Text = string.sub(text,1,i)
coroutine.wrap(soundPlay)()
wait(0.04)
end
wait(1)
script.Parent.Visible = false
end)
I have a second script in the NPC with a proximity prompt
and heres the script
local RP = game:GetService("ReplicatedStorage")
local Events = RP.Events
local text = "you sussy baka"
local triggered = false
game.Players.PlayerAdded:Connect(function(player)
script.Parent.TalkPrompt.Triggered:Connect(function()
if triggered == false then
Events.Talking:FireClient(player,"imposter",text,Color3.new(1, 1, 1)
triggered = true
else
wait(5)
triggered = false
end
end)
end)
and heres a remote event in replicated storage
idk why it doesn’t work I followed a tutorial for this and the UI doesn’t appear when the prompt is triggered