我该如何改变roblox中只有一个用户的颜色?



所以我要做的是做一个脚本,将改变什么用户聊天的颜色,但问题是它同步的其他用户。

local GamePlays = game:GetService("Players")
local GameChat = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local AdminNames = {"Road_Gamer2"}
local MarketplaceService = game:GetService("MarketplaceService")
GameChat.SpeakerAdded:Connect(function(PLRName)

local Play = game.Players[PLRName]

script.Parent.MouseButton1Click:Connect(function()

local Speak = GameChat:GetSpeaker(Play.Name)

Speak:SetExtraData("ChatColor",Color3.fromRGB(2, 152, 0))   
end)

end)

如果您创建一个本地脚本文件,则更改将仅在用户的设备上进行。要在本地脚本中运行服务器连接,可以使用https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events查看通信路径。

如果脚本是服务器脚本,那么它将复制到所有玩家,您可以在本地脚本中重新编写脚本并将其放置在Starter Player Scripts

相关内容

最新更新