I’ve currently been working on fixing my GUI’s and a dialog system to notice a slight problem.
Whenever a player touches a “Dialog Brick”, it should cause a Dialog gui to only appear on their screen and nobody else. The Dialog Bricks have a module with their respected dialogs and modules for setting the look and appearence.
The GUI for some reason appears on everybody’s screen. There are no RemoteEvents/RemoteFunctions whatsoever. I’m also doing it on a Local Script which I presume should work without any problems and should only tween on the client side?
The script is located in the GUI itself:
for _,Dialogs in pairs(CS:GetTagged("DialogPoints")) do
Dialogs.Touched:Connect(function(Part)
if Part.Parent:FindFirstChild("Humanoid") then
if not DEB then
DEB = true
local HRP = Part.Parent:FindFirstChild("HumanoidRootPart")
local TSEQ = require(Dialogs.TextSequence)
if Dialogs:FindFirstChild("IsATutorial") then
HRP.CFrame = Dialogs.CFrame
HRP.Velocity = Vector3.new(0,0,0)
Part.Parent:FindFirstChild("Humanoid").WalkSpeed = 0
end
ShowFrame()
Dialogs:Destroy()
StartDialog(TSEQ)
HideFrame()
Part.Parent:FindFirstChild("Humanoid").WalkSpeed = 16
DEB = false
HRP.Anchored = false
end
end
end)
end
TSEQ is the module from the Dialog parts, it contains all the dialogs needed to be played.
local function StartDialog(TableMsg)
for i = 1, #TableMsg, 1 do
local TextObj = TextModule:New(TF, TableMsg[i].Text, {Font = "SourceSansLight"})
AssignCubeType(TableMsg[i].CubeType)
AssignWantedExpression(TableMsg[i].Expression)
TextObj:Animate(true)
CBTweenIn:Play()
wait(CBTweenIn.TweenInfo.Time)
HPressed = false
repeat wait() until HPressed
CBTweenOut:Play()
wait(CBTweenOut.TweenInfo.Time)
TextObj:Hide()
end
end
The StartDialog is where it starts the dialog and changes the dialog messages.
maybe seperate the “StartDialog” function and take it out of replicated storage? not entirely sure if this would change anything but best to cover all bases.
Hoan, it’s opening the gui when the part is touched by a Model with a humanoid and humanoidRootPart, but you never added a check to see if that model is the player’s character
for _,Dialogs in pairs(CS:GetTagged("DialogPoints")) do
Dialogs.Touched:Connect(function(Part)
if Part.Parent:FindFirstChild("Humanoid") then
if game.Players:GetPlayerFromCharacter(Part.Parent) then
if not DEB then
DEB = true
local HRP = Part.Parent:FindFirstChild("HumanoidRootPart")
local TSEQ = require(Dialogs.TextSequence)
if Dialogs:FindFirstChild("IsATutorial") then
HRP.CFrame = Dialogs.CFrame
HRP.Velocity = Vector3.new(0,0,0)
Part.Parent:FindFirstChild("Humanoid").WalkSpeed = 0
end
ShowFrame()
Dialogs:Destroy()
StartDialog(TSEQ)
HideFrame()
Part.Parent:FindFirstChild("Humanoid").WalkSpeed = 16
DEB = false
HRP.Anchored = false
end
end
end
end)
end