3
This commit is contained in:
1 parent
bdf5eca81f
commit
edb7f16cda
2 files changed
+31
-24
No files matched your search
BIN
Binary file not shown.
@@ -7,7 +7,7 @@ local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScri
|
|||||||
local player = Players.LocalPlayer
|
local player = Players.LocalPlayer
|
||||||
local playerGui = player:WaitForChild("PlayerGui")
|
local playerGui = player:WaitForChild("PlayerGui")
|
||||||
local arena = Modes.geometry(Modes.Procedural)
|
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 arrows: {[BasePart]: Arrow} = {}
|
||||||
|
|
||||||
local function build(marker: BasePart)
|
local function build(marker: BasePart)
|
||||||
@@ -18,8 +18,8 @@ local function build(marker: BasePart)
|
|||||||
gui.AlwaysOnTop = true
|
gui.AlwaysOnTop = true
|
||||||
gui.LightInfluence = 0
|
gui.LightInfluence = 0
|
||||||
gui.MaxDistance = 710
|
gui.MaxDistance = 710
|
||||||
gui.Size = UDim2.fromOffset(108, 108)
|
gui.Size = UDim2.fromOffset(164, 164)
|
||||||
gui.StudsOffsetWorldSpace = Vector3.yAxis * 10
|
gui.StudsOffsetWorldSpace = Vector3.yAxis * 13
|
||||||
gui.Enabled = false
|
gui.Enabled = false
|
||||||
|
|
||||||
local viewport = Instance.new("ViewportFrame")
|
local viewport = Instance.new("ViewportFrame")
|
||||||
@@ -32,36 +32,38 @@ local function build(marker: BasePart)
|
|||||||
viewport.Parent = gui
|
viewport.Parent = gui
|
||||||
|
|
||||||
local camera = Instance.new("Camera")
|
local camera = Instance.new("Camera")
|
||||||
camera.FieldOfView = 29
|
camera.FieldOfView = 31
|
||||||
camera.CFrame = CFrame.lookAt(Vector3.new(0, 0, 9.5), Vector3.zero)
|
camera.CFrame = CFrame.lookAt(Vector3.new(0, 0, 9.7), Vector3.zero)
|
||||||
camera.Parent = viewport
|
camera.Parent = viewport
|
||||||
viewport.CurrentCamera = camera
|
viewport.CurrentCamera = camera
|
||||||
|
|
||||||
|
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")
|
local model = Instance.new("Model")
|
||||||
model.Name = "Arrow"
|
model.Name = "Chevron" .. index
|
||||||
model.Parent = viewport
|
model.Parent = viewport
|
||||||
local arrow: Arrow = {gui = gui, model = model, faces = {}, edges = {}, glow = {}, color = nil, phase = marker.Position.X * .03}
|
table.insert(arrow.chevrons, model)
|
||||||
local function piece(name: string, size: Vector3, pose: CFrame, parent: {BasePart})
|
|
||||||
|
local function piece(name: string, size: Vector3, pose: CFrame, surfaces: {BasePart})
|
||||||
local part = Instance.new("Part")
|
local part = Instance.new("Part")
|
||||||
part.Name = name
|
part.Name = name
|
||||||
part.Size = size
|
part.Size = size * scale
|
||||||
part.CFrame = pose
|
part.CFrame = pose.Rotation + pose.Position * scale
|
||||||
part.Anchored = true
|
part.Anchored = true
|
||||||
part.CanCollide, part.CanQuery, part.CanTouch = false, false, false
|
part.CanCollide, part.CanQuery, part.CanTouch = false, false, false
|
||||||
part.Parent = model
|
part.Parent = model
|
||||||
table.insert(parent, part)
|
table.insert(surfaces, part)
|
||||||
end
|
end
|
||||||
local function segment(position: Vector3, angle: number, size: Vector3)
|
for _, side in {-1, 1} do
|
||||||
local pose = CFrame.new(position) * CFrame.Angles(0, 0, angle)
|
local pose = CFrame.new(.69 * side, 0, 0) * CFrame.Angles(0, 0, math.rad(-53 * side))
|
||||||
piece("Halo", Vector3.new(size.X * 1.42, size.Y + .23, .1),
|
piece("Halo", Vector3.new(.64, 2, .12), pose * CFrame.new(0, 0, -.32), arrow.glow)
|
||||||
pose * CFrame.new(0, 0, -size.Z * .55), arrow.glow)
|
piece("LitEdge", Vector3.new(.43, 1.85, .58), pose, arrow.edges)
|
||||||
piece("LitEdge", size, pose, arrow.edges)
|
piece("BrightFace", Vector3.new(.23, 1.68, .07), pose * CFrame.new(0, 0, .29), arrow.faces)
|
||||||
piece("BrightFace", Vector3.new(size.X * .54, size.Y - .13, .09),
|
end
|
||||||
pose * CFrame.new(0, 0, size.Z * .5), arrow.faces)
|
model.WorldPivot = CFrame.identity
|
||||||
end
|
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
|
arrows[marker] = arrow
|
||||||
gui.Parent = playerGui
|
gui.Parent = playerGui
|
||||||
@@ -93,10 +95,15 @@ local render = RunService.RenderStepped:Connect(function()
|
|||||||
local distance = (camera.CFrame.Position - marker.Position).Magnitude
|
local distance = (camera.CFrame.Position - marker.Position).Magnitude
|
||||||
if distance > arrow.gui.MaxDistance then continue end
|
if distance > arrow.gui.MaxDistance then continue end
|
||||||
local phase = now * 3 + arrow.phase
|
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.Size = UDim2.fromOffset(size, size)
|
||||||
arrow.gui.StudsOffsetWorldSpace = Vector3.yAxis * (10.5 + math.sin(phase) * .95)
|
arrow.gui.StudsOffsetWorldSpace = Vector3.yAxis * (13 + math.sin(phase) * 1.05)
|
||||||
arrow.model:PivotTo(CFrame.fromOrientation(math.rad(-8), .24 + math.sin(phase * .72) * .36, math.sin(phase) * .07))
|
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
|
local color = marker.Color
|
||||||
if arrow.color ~= color then
|
if arrow.color ~= color then
|
||||||
arrow.color = color
|
arrow.color = color
|
||||||
|
|||||||
Reference in new issue
Block a user