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

How Can I Show Cloned Block Position?

I want to show a cloned block before placed. How can I fix this script?


  --Intilaze Player's Mouse
  local playerMouse = game.Players.LocalPlayer:GetMouse()

  local Gridsize = 4
 
  
  --Tool Equipped
script.Parent.Equipped:Connect(function(build)
	
	
	if game.Workspace.GameRunning.Value == true then
		while script.Parent.Unequipped do
			
		local CBlock = game.Workspace.Block:Clone()
	
	
	    CBlock.Parent = game.Workspace
	    busy = true
	repeat
		wait()
	CBlock.Position = Vector3.new((math.floor(playerMouse.Hit.X / Gridsize  ) * Gridsize),(math.floor(playerMouse.Hit.Y / Gridsize + 0.5) * Gridsize) , (math.floor(playerMouse.Hit.Z / Gridsize ) * Gridsize))
		--Mouse Down Event
		build.Button1Down:Connect(function()
		
		CBlock.CFrame = CFrame.new((math.floor(playerMouse.Hit.X / Gridsize  ) * Gridsize) , (math.floor(playerMouse.Hit.Y / Gridsize + 0.5) * Gridsize) , (math.floor(playerMouse.Hit.Z / Gridsize ) * Gridsize))
	   busy = false
	   
		 end)

	until busy == false
	
		end
			
	
		
	end
	
	 
	
end)

   
	

2 answers

You got to better tell us what error messages you are getting. The issue you have(one of them) is that you use cblock.Position instead of cframe.

Actually, My Scipt Working But One At A Time. I want to do is When I Equip Tool, Work Infinitely.

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