This commit is contained in:
Leshyi committed 2026-11-29 19:54:37 +05:00
1 parent bdf5eca81f
commit edb7f16cda
2 files changed
+39 -32

No files matched your search

+39 -32
View File
@@ -7,7 +7,7 @@ local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScri
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local arena = Modes.geometry(Modes.Procedural)
type Arrow = {gui: BillboardGui, model: Model, faces: {BasePart}, edges: {BasePart}, glow: {BasePart}, color: Color3?, phase: number}
type Arrow = {gui: BillboardGui, chevrons: {Model}, faces: {BasePart}, edges: {BasePart}, glow: {BasePart}, color: Color3?, phase: number}
local arrows: {[BasePart]: Arrow} = {}
local function build(marker: BasePart)
@@ -18,8 +18,8 @@ local function build(marker: BasePart)
gui.AlwaysOnTop = true
gui.LightInfluence = 0
gui.MaxDistance = 710
gui.Size = UDim2.fromOffset(108, 108)
gui.StudsOffsetWorldSpace = Vector3.yAxis * 10
gui.Size = UDim2.fromOffset(164, 164)
gui.StudsOffsetWorldSpace = Vector3.yAxis * 13
gui.Enabled = false
local viewport = Instance.new("ViewportFrame")
@@ -32,36 +32,38 @@ local function build(marker: BasePart)
viewport.Parent = gui
local camera = Instance.new("Camera")
camera.FieldOfView = 29
camera.CFrame = CFrame.lookAt(Vector3.new(0, 0, 9.5), Vector3.zero)
camera.FieldOfView = 31
camera.CFrame = CFrame.lookAt(Vector3.new(0, 0, 9.7), Vector3.zero)
camera.Parent = viewport
viewport.CurrentCamera = camera
local model = Instance.new("Model")
model.Name = "Arrow"
model.Parent = viewport
local arrow: Arrow = {gui = gui, model = model, faces = {}, edges = {}, glow = {}, color = nil, phase = marker.Position.X * .03}
local function piece(name: string, size: Vector3, pose: CFrame, parent: {BasePart})
local part = Instance.new("Part")
part.Name = name
part.Size = size
part.CFrame = pose
part.Anchored = true
part.CanCollide, part.CanQuery, part.CanTouch = false, false, false
part.Parent = model
table.insert(parent, part)
local arrow: Arrow = {
gui = gui, chevrons = {}, faces = {}, edges = {}, glow = {}, color = nil, phase = marker.Position.X * .03,
}
for index, scale in {.58, .78, 1} do
local model = Instance.new("Model")
model.Name = "Chevron" .. index
model.Parent = viewport
table.insert(arrow.chevrons, model)
local function piece(name: string, size: Vector3, pose: CFrame, surfaces: {BasePart})
local part = Instance.new("Part")
part.Name = name
part.Size = size * scale
part.CFrame = pose.Rotation + pose.Position * scale
part.Anchored = true
part.CanCollide, part.CanQuery, part.CanTouch = false, false, false
part.Parent = model
table.insert(surfaces, part)
end
for _, side in {-1, 1} do
local pose = CFrame.new(.69 * side, 0, 0) * CFrame.Angles(0, 0, math.rad(-53 * side))
piece("Halo", Vector3.new(.64, 2, .12), pose * CFrame.new(0, 0, -.32), arrow.glow)
piece("LitEdge", Vector3.new(.43, 1.85, .58), pose, arrow.edges)
piece("BrightFace", Vector3.new(.23, 1.68, .07), pose * CFrame.new(0, 0, .29), arrow.faces)
end
model.WorldPivot = CFrame.identity
end
local function segment(position: Vector3, angle: number, size: Vector3)
local pose = CFrame.new(position) * CFrame.Angles(0, 0, angle)
piece("Halo", Vector3.new(size.X * 1.42, size.Y + .23, .1),
pose * CFrame.new(0, 0, -size.Z * .55), arrow.glow)
piece("LitEdge", size, pose, arrow.edges)
piece("BrightFace", Vector3.new(size.X * .54, size.Y - .13, .09),
pose * CFrame.new(0, 0, size.Z * .5), arrow.faces)
end
segment(Vector3.new(0, .38, 0), 0, Vector3.new(.64, 2.13, .68))
segment(Vector3.new(-.51, -.53, 0), math.rad(45), Vector3.new(.64, 1.56, .68))
segment(Vector3.new(.51, -.53, 0), math.rad(-45), Vector3.new(.64, 1.56, .68))
arrows[marker] = arrow
gui.Parent = playerGui
@@ -93,10 +95,15 @@ local render = RunService.RenderStepped:Connect(function()
local distance = (camera.CFrame.Position - marker.Position).Magnitude
if distance > arrow.gui.MaxDistance then continue end
local phase = now * 3 + arrow.phase
local size = math.clamp(math.floor(124 - distance * .08), 76, 124)
local size = math.clamp(math.floor(174 - distance * .11), 104, 174)
arrow.gui.Size = UDim2.fromOffset(size, size)
arrow.gui.StudsOffsetWorldSpace = Vector3.yAxis * (10.5 + math.sin(phase) * .95)
arrow.model:PivotTo(CFrame.fromOrientation(math.rad(-8), .24 + math.sin(phase * .72) * .36, math.sin(phase) * .07))
arrow.gui.StudsOffsetWorldSpace = Vector3.yAxis * (13 + math.sin(phase) * 1.05)
local spacing = 1.15 + math.sin(phase - .9) * .24
for index, chevron in arrow.chevrons do
local level = 2 - index
local tilt = CFrame.Angles(math.rad(-8), .22 + math.sin(phase * .72 + level * .35) * .26, 0)
chevron:PivotTo(CFrame.new(0, level * spacing, 0) * tilt)
end
local color = marker.Color
if arrow.color ~= color then
arrow.color = color