I am trying to make this script place a block, but when I hit the correct button, nothing happens (Yes selected has a value, game.Lighting.1) Here is the script:
--LocalScript local player = game.Players.LocalPlayer local Mouse = player:GetMouse() local Placing = false local Already = false function Place() local Xpos = Mouse.Target.Position.X local Ypos = Mouse.Target.Position.Y local Zpos = Mouse.Target.Position.Z local Surface = Mouse.TargetSurface local TargetPos = Mouse.Target.Position local Selected = game.Players.LocalPlayer.Selected.Value local Clone = Selected:Clone() Clone.Position = Vector3.new(TargetPos) if Surface == 1 then Clone.Position = Vector3.new(Xpos, Ypos + 4, Zpos) else if Surface == 4 then Clone.Position = Vector3.new(Xpos, Ypos - 4, Zpos) else if Surface == 3 then Clone.Position = Vector3.new(Xpos - 4, Ypos, Zpos) else if Surface == 0 then Clone.Position = Vector3.new(Xpos + 4, Ypos, Zpos) else if Surface == 2 then Clone.Position = Vector3.new(Xpos, Ypos, ZPos + 4) if Surface == 5 then Clone.Position = Vector3.new(Xpos, Ypos, Zpos - 4) else print(" ") end end end end end end end Mouse.Button2Down:connect(function() local Find = Mouse.Target:FindFirstChild("Xplo") if not Already then Already = true Placing = true if Find then while true do wait(1) if Placing == true then Place() else print(" ") end end end end end) Mouse.Button2Up:connect(function() Already = false Placing = false end)