Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt to concatenate Color3 with string? [SOLVED]

Asked by 2 years ago
Edited 2 years ago

I want to make it so when a player touches a specific part, a chat message pops up, using a LocalScript in StarterPlayerScripts, I had a remote event fire all clients to that local script from a server script when that specific part is touched, here's the LocalScript:

local StarterGui = game:GetService("StarterGui")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local plr = game:GetService("Players").LocalPlayer

local popupEv = ReplicatedStorage:WaitForChild("Popup")

popupEv.OnClientEvent:Connect(function(color, difficulty, playerName, player)

    if plr.OtherStats.PopupEnabled.Value == 2 or plr.OtherStats.PopupEnabled.Value == 4 then 
        print("ITS OFF")
        return
    elseif plr.OtherStats.PopupEnabled.Value == 1 or plr.OtherStats.PopupEnabled.Value == 3 then

        print("ITS ON")

        StarterGui:SetCore(
            "ChatMakeSystemMessage",{
            Text =  "[SERVER] "..playerName.." has beaten the difficulty: "..difficulty..", GG",
            Color = color,
            TextStrokeColor3 = Color3.fromRGB(0,0,0),
            TextStrokeTransparency = 0,
            Font = Enum.Font.Arcade
        })
    end
end)

but there is an annoying error popping up everytime I touch that part which says:

Players.ZombieApocalypz3.PlayerScripts.PopupMessages:16: attempt to concatenate Color3 with string

the error is on line 16

1 answer

Log in to vote
0
Answered by 2 years ago

Sorry, I just found out that I didn't need to put the "player" arguement at first if I'm using "FireAllClients" function, While I did that, every arguement got shifted in the local script. Now it's fixed. Sorry about that.

Ad

Answer this question