When I just did game.Players.LocalPlayer.Chatted it worked fine but now that I added it into a function it just doesn’t work.
It returns that the player is valid but it wont print got past!!!
function SplitMessageParts(SplitType,Message,ReturnPart)
if SplitType == "Space" then
local Split = Message:split(" ")
return Split[ReturnPart]
else
--
end
end
wait(game:IsLoaded())
wait(3)
function IsAPlayer(Name)
for i,v in pairs(game.Players:GetChildren()) do
if v.Name == Name then
print("Name found!!! returning")
return Name
else
print("N ame wasnt found in IsAPlayer Lol")
return false
end
end
end
function Chatted(Requirements,Type)
if Type == "ReturnPlayer" then
game.Players.LocalPlayer.Chatted:Connect(function(Message)
print("Chatted xD")
if Chatted(SplitMessageParts("Space",Message,1) == Requirements[1] and SplitMessageParts("Space",Message,2) == Requirements[2] and SplitMessageParts("Space",Message,3) == IsAPlayer(SplitMessageParts("Space",Message,3))) then
print("got past!!!")
return Message
end
end)
elseif Type == "Normal" then
end
end