In some games in roblox like Super Hero Life II, Robloxian Highschool, the players’ roleplay names appear in the chat instead of their actual names like this:
I was wondering how i could do that in my game and make it so players’ roleplay names actually appear on the chat like that.
No, but i’m pretty sure the error is in the server script, i inserted prints in both scripts and the server script didn’t print
script.Parent.MouseButton1Click:Connect(function()
local nickname = script.Parent.Parent.TextBox.Text
game.ReplicatedStorage.Events.changeNickname:FireServer(nickname)
print("text is " .. nickname)
end)
local changeNickname = game.ReplicatedStorage.Events.changeNickname
local ChatService = require(script.Parent:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
changeNickname.OnServerEvent:Connect(function(player, nickname)
print("received, text is " .. nickname)
local Speaker = ChatService:GetSpeaker(player.Name)
Speaker:SetExtraData('DisplayName', nickname)
print("done")
end)
Well if it’s in a folder then it wouldn’t be local ChatService = require(**script.Parent**:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))