I have two scripts. A local one and a server one The server one is inside the ServerScriptService The client one is inside the StarterGui.
--server script. its not the entire script.
player.Chatted:Connect(function(text)
print(dummyCount)
local chattext = string.lower(text)
if chattext == "/createdummy" or chattext == "/cd" then
if dummyCount < 4 then
local clonedDummy = dummy:Clone()
clonedDummy.Parent = folderPerPlayer
clonedDummy.Name = player.Name.." Dummy "..dummyCount
clonedDummy:MoveTo(humanoidRootPart.Position + Vector3.new(math.random(-10, 13), 7, math.random(-9, 12)))
elseif dummyCount == 4 then
print(player.Name)
getWarning:FireClient(player, "(You can only see this!) You can't add anymore dummies! Use /removedummy (/rd) to delete all dummies!") --it wont fire
end
end
<><><><><><><><><><><><><><><><><>
--client script, full script. wont print message.
local starterGui = game:GetService("StarterGui")
local replicatedStorage = game:GetService("ReplicatedStorage")
local getWarning = replicatedStorage:WaitForChild("getWarning")
local function CreateSystemMessage(message, color, font, fontsize)
starterGui:SetCore("ChatMakeSystemMessage",{
Text = message;
Color = color;
Font = font;
FontSize = fontsize;
})
end
while true do
CreateSystemMessage(
"{System} Chat /createdummy (/cd) to spawn dummies and /removedummy (/rd) to remove dummies.",
Color3.fromRGB(252, 165, 3),
Enum.Font.FredokaOne,
56
)
wait(420)
end
getWarning.OnClientEvent:Connect(function(message)
print(message) -- wont print?
end)
--[[
CreateSystemMessage(
message,
Color3.fromRGB(255, 115, 115),
Enum.Font.FredokaOne,
56
)
]]

2 comments
If you found this answer helpful then please accept this answer and possibly help others who may look for the same answer.
Oh god I'm so dumb. Thank you so much <3