So I was scripting a game while I wanted a player’s name to be put in a print command so I went to the top where I put all my locals and added: local player = game.Players.LocalPlayer
then I went down and wrote: print("Checking if"player.Name"Has regular NPC dialogue settings")
And then I noticed that the player.Name
was underlined with red meaning that there is an error with it, And I do not understand why it is giving me an error it should work because as I said, At the top I wrote: local player = game.Players.LocalPlayer
. I don’t need this feature only for the print command, I also need it for other things because if I need it for the print command only, It would just be a waste of time. (I used a local script.)
This is what was in the LocalScript:
local part = workspace.TalkPart1
local textlabel = script.Parent.Frame.TextLabel
local CloseBtn = script.Parent.Frame.CloseBtn
local ContinueBtn = script.Parent.Frame.ContinueBtn
local player = game.Players.LocalPlayer
local PlayerCancelledDialogue = print(“A Player has Cancelled their NPC Conversation.”)
local PlayerContinuedDialogue = print(“A Player has Continued their NPC Conversation.”)
part.ClickDetector.MouseClick:Connect(function()
script.Parent.Frame.Visible = true
wait(0.2)
textlabel.TextScaled = true
textlabel.Text = “H”
wait(0.1)
textlabel.Text = “He”
wait(0.1)
textlabel.Text = “Hey”
wait(0.1)
textlabel.Text = "Hey "
wait(0.1)
textlabel.Text = “Hey T”
wait(0.1)
textlabel.Text = “Hey Th”
wait(0.1)
textlabel.Text = “Hey The”
wait(0.1)
textlabel.Text = “Hey Ther”
wait(0.1)
textlabel.Text = “Hey There”
wait(0.1)
textlabel.Text = “Hey There!”
wait(0.1)
textlabel.Text = "Hey There! "
wait(0.1)
textlabel.Text = “Hey There! Y”
wait(0.1)
textlabel.Text = “Hey There! Yo”
wait(0.1)
textlabel.Text = “Hey There! You”
wait(0.1)
textlabel.Text = “Hey There! You M”
wait(0.1)
textlabel.Text = “Hey There! You Mi”
wait(0.1)
textlabel.Text = “Hey There! You Mig”
wait(0.1)
textlabel.Text = “Hey There! You Migh”
wait(0.1)
textlabel.Text = “Hey There! You Might”
wait(0.1)
textlabel.Text = “Hey There! You Might”
wait(0.1)
textlabel.Text = “Hey There! You Might n”
wait(0.1)
textlabel.Text = “Hey There! You Might no”
wait(0.1)
textlabel.Text = “Hey There! You Might not”
wait(0.1)
textlabel.Text = "Hey There! You Might not "
wait(0.1)
textlabel.Text = “Hey There! You Might not k”
wait(0.1)
textlabel.Text = “Hey There! You Might not kn”
wait(0.1)
textlabel.Text = “Hey There! You Might not kno”
wait(0.1)
textlabel.Text = “Hey There! You Might not know”
wait(0.1)
textlabel.Text = "Hey There! You Might not know "
wait(0.1)
textlabel.Text = “Hey There! You Might not know m”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me,”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, B”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, Bu”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I f”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I fo”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I fou”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I foun”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But I found "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found y”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found yo”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you i”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But I found you in "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in t”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in th”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in thi”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But I found you in this "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this c”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this ca”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cav”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But I found you in this cave "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave l”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave ly”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lyi”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lyin”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying”
wait(0.1)
textlabel.Text = "Hey There! You Might not know me, But I found you in this cave lying "
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying d”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying do”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying dow”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying down”
wait(0.1)
textlabel.Text = “Hey There! You Might not know me, But I found you in this cave lying down!”
wait(0.1)
wait(3)
print(“Checking if"player.Name"Has regular NPC Dialogue Settings…”)
ContinueBtn.Visible = true
CloseBtn.Visible = true
CloseBtn.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = false
PlayerCancelledDialogue
end)
ContinueBtn.MouseButton1Click:Connect(function()
PlayerContinuedDialogue
if textlabel.TextScaled == false then
textlabel.TextScaled = true
print(“Error; A Player had their NPC TextLabel settings change from regular.”)
end
textlabel.Text = “I”
wait(0.1)
textlabel.Text = “I’”
wait(0.1)
textlabel.Text = “I’m”
wait(0.1)
textlabel.Text = "I’m "
wait(0.1)
textlabel.Text = “I’m M”
wait(0.1)
textlabel.Text = “I’m Mo”
wait(0.1)
textlabel.Text = “I’m Mor”
wait(0.1)
textlabel.Text = “I’m Morg”
wait(0.1)
textlabel.Text = “I’m Morga”
wait(0.1)
textlabel.Text = “I’m Morgan”
wait(0.1)
textlabel.Text = “I’m Morgan!”
wait(1)
textlabel.Text = “L”
wait(0.1)
textlabel.Text = “Li”
wait(0.1)
textlabel.Text = “Lis”
wait(0.1)
textlabel.Text = “List”
wait(0.1)
textlabel.Text = “Liste”
wait(0.1)
textlabel.Text = “Liste”
wait(0.1)
textlabel.Text = “Listen,”
wait(0.1)
textlabel.Text = “Listen, W”
wait(0.1)
textlabel.Text = “Listen, We”
wait(0.1)
textlabel.Text = "Listen, We "
wait(0.1)
textlabel.Text = “Listen, We d”
wait(0.1)
textlabel.Text = “Listen, We do”
wait(0.1)
textlabel.Text = “Listen, We don”
wait(0.1)
textlabel.Text = “Listen, We don’”
wait(0.1)
textlabel.Text = “Listen, We don’t”
wait(0.1)
textlabel.Text = “Listen, We don’t”
wait(0.1)
textlabel.Text = "Listen, We don’t "
wait(0.1)
textlabel.Text = “Listen, We don’t h”
wait(0.1)
textlabel.Text = “Listen, We don’t ha”
wait(0.1)
textlabel.Text = “Listen, We don’t”
wait(0.1)
textlabel.Text = "Listen, We don’t "
wait(0.1)
textlabel.Text = "Listen, We don’t "
wait(0.1)
print(“SCRIPT WILL BE FINSHED AFTER THE ‘player.Name’ PROBLEM GETS FIXED…”)
end)
end)
