Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.ReplicatedStorage.Events.PlaceWall.OnServerEvent:Connect(function(Player, Point1, Point2, Plot)
- print(Point1, Point2)
- local Mag = (Point1 - Point2).magnitude
- local ray = Ray.new(Point1, (Point1 - Point2).unit * Mag)
- local part, position = workspace:FindPartOnRay(ray, Player.Character)
- local Wall = Instance.new("Part", Plot.Objects.Walls)
- Wall.Anchored = true
- Wall.Transparency = 0
- Wall.Name = "Wall"
- Wall.TopSurface = Enum.SurfaceType.Smooth
- Wall.BottomSurface = Enum.SurfaceType.Smooth
- local Distance = (Point1 - position).magnitude
- Wall.Size = Vector3.new(.5, 10, math.floor(Mag)) + Vector3.new(0,0,.75)
- Wall.CFrame = CFrame.new(Point1, position) * CFrame.new(0,0,Mag / 2)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement