You can write your topic however you want, but you need to answer these questions:
-
I made a modulescript that will be used whenever i need to give a player an item but the function inputs are all messed up
-
Whenever i run the function it says that character is not a valid member of tool “lighting.testtool”
local Module = require(game.ReplicatedStorage:WaitForChild("ItemManager"))
local item = game.Lighting.testtool
script.parent.Triggered:Connect(function(player)
print(player,item)
Module.GiveItem(player,item,true)
end)
local module = {}
function module:GiveItem(p,item,unique)
print(p,item,unique)
if unique then
if not p.Backpack:FindFirstChild(item.Name)then
if not p.Character:FindFirstChild(item.Name) then
Give(p,item)
end
end
elseif not unique then
Give(p,item)
end
end
function Give(player,item)
print(player,item)
player.Character.Humanoid:UnequipTools()
if #player.Backpack:GetChildren() < 10 then
local g = item:Clone()
g.Parent = player.Backpack
end
end
return module