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)
In Line 06 You Made An Error; Instead Of Putting;
if leaderstats.Money.Value = Money > 0 then
Put;
if leaderstats.Money.Value > 0 then
You can't get player from MouseButton1Click. You need to use events.