Sorry for the horrible code.
I want the game to listen out for objects stored in my serverstorage (table), and when someone calls it out it spawns it in game. At the moment it prints twice and it's always nil.
local chat = game:GetService("Chat")
adjectives = {""}
objects = game.ServerStorage:GetChildren()
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
player.Chatted:Connect(function(msg)
for _,v in ipairs(objects) do
local cool = table.find(objects, msg)
print(cool, "|" .. msg)
if msg == cool then
Instance.new("Part",game.Workspace)
end
--local clone = msg:Clone()
--clone.Parent = game.Workspace
--clone.Position = humanoidRootPart.Position
end
end)
end)
end)
my explorer/output:
https://i.imgur.com/iXPVoNx.png
thanks!

1 comment
didn't seem to work. thanks though!