So,im trying to do a building script that doesn't use decimals,more precisely but the error is:
bad argument #3 to 'Position' (Vector3 expected, got Number)
here's the script:
Player = script.Parent.Parent.Parent.Parent.Parent.Parent
Mouse = Player:GetMouse()
function Build()
if Mouse.Target.Parent.Name == "Cell" then
if Mouse.Target.Parent.Shrine.ShrineOrb.Owner.Value == Player.Name then
print ("This Is Your Base,Building...")
local Part = Instance.new("Part", game.Workspace.BuildenBlocks)
Part.Name = "BuildenBlock"
local MouseCFrame = Mouse.Hit
print (MouseCFrame.p)
Part.Anchored = true
local x1 = math.floor(MouseCFrame.x)
local y1 = math.floor(MouseCFrame.y)
local z1 = math.floor(MouseCFrame.z)
print (x1)
print (y1)
print (z1)
Part.Position = (x1 + y1 + z1)
Part.Rotation = Vector3.new(0,0,0)
else
print ("This Is Not Your Base,Build Cancelled")
end
end
end
Mouse.Button1Down:connect(Build)

1 comment
thx!