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

How do I make it so if I click a block it spawns a tool?

Heres the code I tried:

local Clicker = script.Parent 
	local Object = game.ReplicatedStorage:WaitForChild("Key3") 
	local ObjectSpawn = game.Workspace:WaitForChild("ObjectSpawn")

	Clicker.onClicked:Connect(function()
	    local CloneObject = Object:Clone()
	    CloneObject.Parent = game.Workspace
	CloneObject.Position = Vector3.new(ObjectSpawn.Position)
		end)

1 answer

UPDATE:

I figured it out, the script I used:

script.Parent.MouseClick:Connect(function() 
	local Object = game.ReplicatedStorage.Key3 
	Object.Parent = workspace 
	Object.Position = script.Parent.Parent.Position + Vector3.new(-105.8, 1.05, 63.4)

end)

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