Hey, im working on a chat comman script (localscript in StarterPlayerScripts)
Code:
local plr = game.Players.LocalPlayer
local charactersFolder = game.ReplicatedStorage.Characters
plr.Chatted:Connect(function(msg)
local loweredText = string.lower(msg)
if string.find(loweredText, "!spawn") then
local SplitMessage = string.split(msg, " ")
local Type = SplitMessage[2]
print("Chatted, "..Type)
if Type == "Normal" then
local dummyClone = charactersFolder["Normal Dummy"]:Clone()
dummyClone.Parent = workspace.Characters
dummyClone:MoveTo(plr.Character.Torso.CFrame * CFrame.new(0,0,-3))
elseif Type == "Weak" or "Weakest" then
local dummyClone = charactersFolder["Weakest Dummy"]:Clone()
dummyClone.Parent = workspace.Characters
dummyClone:MoveTo(plr.Character.Torso.CFrame * CFrame.new(0,0,-3))
elseif Type == "Strong" or "Strongest" then
local dummyClone = charactersFolder["Strongest Dummy"]:Clone()
dummyClone.Parent = workspace.Characters
dummyClone:MoveTo(plr.Character.Torso.CFrame * CFrame.new(0,0,-3))
elseif Type == "Inv" or "Invinsible" then
local dummyClone = charactersFolder["Invincible Dummy"]:Clone()
dummyClone.Parent = workspace.Characters
dummyClone:MoveTo(plr.Character.Torso.CFrame * CFrame.new(0,0,-3))
end
print("Spawned "..Type.." Dummy")
end
if msg == "!clear" then
workspace.Characters:ClearAllChildren()
end
end)
The output is not printing anything, even with the !clear.
Thanks!