I inserted a local script in the brick. Am I supposed to use a normal script? I also used the code in the normal script and it doesn't work either.
local dialogue = game.StarterGui.Dialogue1 script.Parent.ClickDetector.MouseClick:Connect(function() wait(1) dialogue.T1.Visible = true wait(3) dialogue.T1.Visible = false wait(1) dialogue.T2.Visible = true wait(3) dialogue.T2.Visible = false end)
For this you have to use remote event. Note that it should be a client event.
First Part: Make a normal script parented to part in workspace.
local CD = script.Parent.ClickDetector local toggle = false CD.MouseClick:Connect(function(player) if toggle == false then toggle = true game.ReplicatedStorage.RemoteEvent:FireClient(player, toggle) elseif toggle == true then toggle = false game.ReplicatedStorage.RemoteEvent:FireClient(player, toggle) end end)
Now Second Part: Make a local script parented to ScreenGui in StarterGui.
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(toggle) if toggle == true then script.Parent.Frame.Visible = true else script.Parent.Frame.Visible = false end end)
Hope this works for you as it is doing for me!
Local Script
local dialogue = game.Players.LocalPlayer.PlayerGui. Dialogue1 script.Parent.ClickDetector.MouseClick:Connect(function() wait(1) dialogue.T1.Visible = true wait(3) dialogue.T1.Visible = false wait(1) dialogue.T2.Visible = true wait(3) dialogue.T2.Visible = false end)