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

I can't clone tools by clicking a tool giver?

So i made a keycard for my basement which works, but the thing is, i made it so you need to find the card. But the problem is when you click the card AKA tool giver, it only lets 1 person hold it, basically if someone else clicks the tool giver, the keycard from my inventory gets taken away and given to the other player. How do i make it so it just clones the item? This is the script.

local tool = game.ServerStorage.Card
local klone = tool:clone()
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	if klone.Parent ~= plr.Backpack then
		klone.Parent = plr.Backpack
	end
end)

I got this from this video https://www.youtube.com/watch?v=orJMUz8b5nE

1 answer

✓ Accepted answer

Well its simple, you made a clone of the tool before the player even clicked the tool giver and every time you say "klone" its referring to the one specific clone. You need to make a clone when the player clicked the tool giver

local tool = game.ServerStorage.Card

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	local klone = tool:clone()
	if klone.Parent ~= plr.Backpack then
		klone.Parent = plr.Backpack
	end
end)

1 comment

0

This is correct, accept this answer!

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