如何在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)
点赞
用户14312523
用户14312523

如果此脚本为服务器脚本,则它将复制到所有玩家,您可以将脚本重新写为本地脚本,并将其放置在StarterPlayerScripts中。

2021-03-11 10:54:05
用户15370369
用户15370369

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

2021-03-11 14:19:10