this is my local script that makes the player attack and say "Mace Slam!" when a key is activated. is it possible to make the chat text a custom color too? the one i have currently makes ALL the texts blue, but i only want it to make the one text blue.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local debounce = false
local cooldownLength = 10
local textchannel = game:GetService("TextChatService"):WaitForChild("TextChannels"):WaitForChild("RBXGeneral") -- References the general TextChannel
local message = "Mace Slam!"
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://18876757899"
local UIS = game:GetService("UserInputService")
local keybind = Enum.KeyCode.Q
local inputConnection
local function performSlam()
if not debounce then
debounce = true
character.Humanoid:LoadAnimation(animation):Play()
game:GetService("TextChatService"):WaitForChild("BubbleChatConfiguration").TextColor3 = Color3.fromRGB(38, 52, 255)
textchannel:SendAsync(message)
wait(0.45)
tool.SlamTaken:FireServer()
tool.Handle.Slam:Play()
wait(cooldownLength)
debounce = false
end
end
local function onInputBegan(input, gameProcessed)
if not gameProcessed and input.KeyCode == keybind then
if tool.Parent == character then
performSlam()
end
end
end
local function onEquipped()
inputConnection = UIS.InputBegan:Connect(onInputBegan)
end
local function onUnequipped()
if inputConnection then
inputConnection:Disconnect()
inputConnection = nil
end
end
tool.Equipped:Connect(onEquipped)
tool.Unequipped:Connect(onUnequipped)```