Hello! I am new to scripting and i tried scripting using two other scripts and i tried to make a script and it doesnt work, i dont really know whats right or wrong so it would be helpful if anyone could help me.
local ToolNames = {"SPECTRE M4"}
local Storage = game:GetService("ServerStorage")
script.Parent.MouseButton1Click:Connect(function(Player)
if leaderstats.Money.Value = Money > 0 then
local Backpack = Player:WaitForChild("Backpack")
for i = 1 #ToolNames do
local tool = Storage:FindFirstChild(ToolNames[i])
if tool then
Tool:clone().Parent = Backpack
end
end
end
end)

3 comments
do i have to do this in localscript or regular script?
local
Sorry I Mean ServerScript/Regular Script