I’m trying to refer to the localplayer in a chat bubble but this isn’t working
Script:
game:GetService(“Chat”):Chat(game.Workspace.MatthewSmiIes.Head, "Alright, I’ll call " + game.Players.LocalPlayer.Name, Enum.ChatColor.White)
I’m trying to refer to the localplayer in a chat bubble but this isn’t working
Script:
game:GetService(“Chat”):Chat(game.Workspace.MatthewSmiIes.Head, "Alright, I’ll call " + game.Players.LocalPlayer.Name, Enum.ChatColor.White)
Also i’m trying to recreate Returning to Reality and this is one of the cutscenes so let me know if there is anything wrong.
This should be:
"Alright, I'll call"..game.Players.LocalPlayer.Name
This is how Lua does it, the plus sign is done in other languages. On Lua, you use ..
Now its saying “attempt to index nil with ‘Name’”
This is because the script is being run on the server, if you tried calling game.Players.LocalPlayer.Name, it’ll return the player’s name. You’ll need to find a way to get the player’s name on the server. Can be done through a remote event.
Oh alright thanks for the help!