As mentioned before, this is because you are making changes to the StarterGui, not the PlayerGui.
This is because StarterGui is where you store your games' gui. When the player's character is loaded, ROBLOX automatically clones all of StarterGui's contents to the PlayerGui. These are the GUIs which are displayed to each individual player.
I should also mention your typewriter script. It's pretty decent, but if you want ROBLOX provides a typewriter module which features translations, which I will paste below if you want to have a look at it.
local SOURCE_LOCALE = "en"
local LocalizationService = game:GetService("LocalizationService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local translator = nil
pcall(function()
translator = LocalizationService:GetTranslatorForPlayerAsync(player)
end)
if not translator then
pcall(function()
translator = LocalizationService:GetTranslatorForLocaleAsync(SOURCE_LOCALE)
end)
end
local TypeWriter = {}
local defaultConfigurations = {
delayTime = 0.2,
extraDelayOnSpace = true
}
function TypeWriter.configure(configurations)
for key, value in pairs(defaultConfigurations) do
local newValue = configurations[key]
if newValue ~= nil then
defaultConfigurations[key] = newValue
else
warn(key .. " is not a valid configuration for TypeWriter module")
end
end
end
function TypeWriter.typeWrite(guiObject, text)
guiObject.AutoLocalize = false
guiObject.Text = ""
local displayText = text
if translator then
displayText = translator:Translate(guiObject, text)
end
for first, last in utf8.graphemes(displayText) do
local grapheme = string.sub(displayText, first, last)
guiObject.Text = guiObject.Text .. grapheme
if defaultConfigurations.extraDelayOnSpace and grapheme == " " then
wait(defaultConfigurations.delayTime)
end
wait(defaultConfigurations.delayTime)
end
end
return TypeWriter
Anyway, use whichever you prefer. The one above does handle translations though, which makes your game more accessible.
As for your script, there is another thing wrong with it. Now we've sorted the playerGui issue, let's talk about line 6
local name = game.StarterGui.ConversationGui.Name
This would store the variable, literally as
local name = "ConversationGui"
Why?
Sometimes the Name of an object is the same as that of a property of its Parent. When using the dot operator, properties take precedence over children if they share a name.
Therefore to fix that, we use FindFirstChild() or any similar method.
local part = workspace.Button
local player = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
local proximityprompt = workspace.Button.ProximityPrompt
local playerui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local dialog = playerui.ConversationGui
local textlabel = dialog.TextHere
local name = dialog:FindFirstChild("Name")
local function typewrite(object,text)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(0.025)
end
end
proximityprompt.TriggerEnded:Connect(function()
if dialog.Enabled == true then
return
elseif dialog.Enabled == false then
proximityprompt.Enabled = false
wait(0.2)
dialog.Enabled = true
typewrite(textlabel,"HEY! This is private property! Don't make-")
wait(2)
textlabel.TextXAlignment = 2
textlabel.TextYAlignment = 1
typewrite(textlabel,"Wait...")
wait(2)
typewrite(textlabel,"You- You're HIM!")
wait(2)
textlabel.TextXAlignment = 0
textlabel.TextYAlignment = 0
typewrite(textlabel,"I'm sorry, that wasn't very nice of me. I'm sure you're a amazing human being!")
wait(3)
textlabel.TextXAlignment = 2
textlabel.TextYAlignment = 1
typewrite(textlabel,"M-My name is Xanathaniel.")
typewrite(name,"Xanathaniel")
wait(2)
textlabel.TextXAlignment = 0
textlabel.TextYAlignment = 0
typewrite(textlabel,"Come back if you ever need help with anything!")
wait(2)
dialog.Enabled = false
wait(0.2)
proximityprompt.Enabled = true
end
end)
3 comments
Much more detailed than mine.
I thought about everything you said and fixed my script, but the entire ConversationGui.Enabled does nothing even thought it's in the script? Also it gives no errors Idk if that's good or bad.
No errors usually means there is nothing wrong with it, it's simply just not doing what you intended it to but correctly. Not sure what could be wrong