I have a global script that is supposed to change some properties of a player's GUI's, but it isn't working. I'm assuming it has something to do with the server/client boundary but, even if it is, I don't know how to fix it. Any help would be appreciated.
local part = script.Parent
local chatting = false
function onClicked(plr)
local dialog = plr.PlayerGui.NPCDialog.DialogFrame
local words = dialog.Chat.Text
local name = dialog.NPCName.Text
if chatting == false then
chatting = true
print("Chatting with NPC")
name = script:FindFirstAncestorOfClass("Model").Name
words = "Ey b0ss"
dialog.Visible = true -- displays the chat
end
end
part.ClickDetector.MouseClick:connect(onClicked)
This script successfully makes the GUI visible, but doesn't change the text as it should.
