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 3 years ago
Edited 3 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:

01local StarterGui = game:GetService("StarterGui")
02local ReplicatedStorage = game:GetService("ReplicatedStorage")
03local plr = game:GetService("Players").LocalPlayer
04 
05local popupEv = ReplicatedStorage:WaitForChild("Popup")
06 
07popupEv.OnClientEvent:Connect(function(color, difficulty, playerName, player)
08 
09    if plr.OtherStats.PopupEnabled.Value == 2 or plr.OtherStats.PopupEnabled.Value == 4 then
10        print("ITS OFF")
11        return
12    elseif plr.OtherStats.PopupEnabled.Value == 1 or plr.OtherStats.PopupEnabled.Value == 3 then
13 
14        print("ITS ON")
15 
View all 25 lines...

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 3 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