Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Clone a tool using values?

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)

2 answers

✓ Accepted answer

In Line 06 You Made An Error; Instead Of Putting;

 if  leaderstats.Money.Value = Money > 0 then

Put;

if  leaderstats.Money.Value > 0 then

3 comments

0

do i have to do this in localscript or regular script?

0

local

0

Sorry I Mean ServerScript/Regular Script

You can't get player from MouseButton1Click. You need to use events.

This discussion is preserved as it was. New answers, comments, and votes are closed.