http://prntscr.com/gwrfn8 Problem: Not copying the Bed Model inside of it
Errors: None
-- Initialization Player = game.Players.LocalPlayer mouse = Player:GetMouse() -- UI ScreenGui = script.Parent Purchase = ScreenGui:WaitForChild("Place") -- Varaibles InPlaceMode = false NewTurret = nil CanPlace = false -- Models Turrets = game.ReplicatedStorage:WaitForChild("Turrets") BaseTurret = Turrets:WaitForChild("Turret01") --Hold shift to multibuy mouse.Button1Down:connect(function() if InPlaceMode == true and CanPlace == true then InPlaceMode = false if NewTurret and NewTurret:FindFirstChild("SelectionBox") then NewTurret:FindFirstChild("SelectionBox"):Destroy() for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then v.Transparency = 0 end end end end end) Purchase.MouseButton1Down:Connect(function() if not InPlaceMode then InPlaceMode = true NewTurret = BaseTurret:Clone() NewTurret.Parent = game.Workspace local SelectionBox = Instance.new("SelectionBox",NewTurret) SelectionBox.Color3 = Color3.new(0/255, 255/255, 0/255) SelectionBox.Adornee = NewTurret mouse.TargetFilter = NewTurret while InPlaceMode do print("henlo") wait() local Hit = mouse.Hit.p local X0, Y0, Z0 = Hit.X - math.fmod(Hit.X,4), Hit.Y - math.fmod(Hit.Y,1), Hit.Z - math.fmod(Hit.Z,4) if mouse.Target and mouse.Target.Name == "BuildSpace" then NewTurret.Position = (Vector3.new(X0,Y0,Z0)) SelectionBox.Color3 = Color3.new(0/255, 255/255, 0/255) SelectionBox.Adornee = NewTurret CanPlace = true for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then v.Transparency = 0 end end elseif mouse.Target then --NewTurret:MoveTo(Vector3.new(X0,Y0,Z0)) CanPlace = false SelectionBox.Color3 = Color3.new(255/255, 71/255, 74/255) for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then --v.Color = Color3.new(255/255, 71/255, 74/255) v.Transparency = 1 SelectionBox.Adornee = nil end end end end end end)
Use Model:MoveTo(Vector3) on line 46
-- Initialization Player = game.Players.LocalPlayer mouse = Player:GetMouse() -- UI ScreenGui = script.Parent Purchase = ScreenGui:WaitForChild("Place") -- Varaibles InPlaceMode = false NewTurret = nil CanPlace = false -- Models Turrets = game.ReplicatedStorage:WaitForChild("Turrets") BaseTurret = Turrets:WaitForChild("Turret01") --Hold shift to multibuy mouse.Button1Down:connect(function() if InPlaceMode == true and CanPlace == true then InPlaceMode = false if NewTurret and NewTurret:FindFirstChild("SelectionBox") then NewTurret:FindFirstChild("SelectionBox"):Destroy() for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then v.Transparency = 0 end end end end end) Purchase.MouseButton1Down:Connect(function() if not InPlaceMode then InPlaceMode = true NewTurret = BaseTurret:Clone() NewTurret.Parent = game.Workspace local SelectionBox = Instance.new("SelectionBox",NewTurret) SelectionBox.Color3 = Color3.new(0/255, 255/255, 0/255) SelectionBox.Adornee = NewTurret mouse.TargetFilter = NewTurret while InPlaceMode do print("henlo") wait() local Hit = mouse.Hit.p local X0, Y0, Z0 = Hit.X - math.fmod(Hit.X,4), Hit.Y - math.fmod(Hit.Y,1), Hit.Z - math.fmod(Hit.Z,4) if mouse.Target and mouse.Target.Name == "BuildSpace" then NewTurret.Bed:MoveTo(Vector3.new(X0,Y0,Z0)) SelectionBox.Color3 = Color3.new(0/255, 255/255, 0/255) SelectionBox.Adornee = NewTurret CanPlace = true for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then v.Transparency = 0 end end elseif mouse.Target then --NewTurret:MoveTo(Vector3.new(X0,Y0,Z0)) CanPlace = false SelectionBox.Color3 = Color3.new(255/255, 71/255, 74/255) for i,v in pairs (NewTurret:GetChildren()) do if v:IsA("BasePart") then --v.Color = Color3.new(255/255, 71/255, 74/255) v.Transparency = 1 SelectionBox.Adornee = nil end end end end end end)