So the other day I was testing around with the idea of not putting anything in tools when I thought of the idea of using collection service to handle a certain subset of tools. So I went to work on the script… and it didn’t work. Any help would be useful since I really don’t want to fall back to my older system
local CollectionService = game:GetService(“CollectionService”)
for i, v : Tool in pairs(CollectionService:GetTagged(“Melee”)) do
all I could do is remove unnecessary things but essentially does the exact same thing
local cs = game:GetService("CollectionService")
local meleeweapons = cs:GetTagged("Melee")
for _, melee in pairs(meleeweapons) do
melee.Activated:Connect(function()
print("wow")
end)
melee.Equipped:Connect(function()
print("wow")
end)
end
I don’t think using CollectionService for something like this is a good idea. I would suggest working with ModuleScripts instead so tools with similar functionalities can use the same library of functions.
The thing is tho is that the tools I’m making are going to have a predefined list of things to do (M1,Heavy attack etc). My whole idea is that when i activate these tools i can fire the server with the tools name and from there i can use a module script to handle the variations in abilities. Its not like the tools I’m using are going to be varied at all