-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfairyscript.lua
More file actions
76 lines (54 loc) · 1.51 KB
/
fairyscript.lua
File metadata and controls
76 lines (54 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
local markerTemp = game:GetService("ServerStorage").Marker
local RunService = game:GetService('RunService')
local fairyBasicPosition = Vector3.new( 224, 232, -16 )
local ran = false
local marker = markerTemp:Clone()
local ServerStorage = game:GetService("ServerStorage")
local Bezier = require(game:GetService("ReplicatedStorage").Bezier)
local p0 = workspace.Bezier.P0.Position
local p1 = workspace.Bezier.P1.Position
local p2 = workspace.Bezier.P2.Position
local p3 = workspace.Bezier.P3.Position
local marketTemp = game:GetService("ServerStorage").Marker
local curve = Bezier.new(100,p0,p1,p2,p3)
local t = 0
--[[
local marker = markerTemp:Clone()
marker.Position = blueFairyCalc(t)
marker.Parent = workspace
]]--
--[[
function createMarker(step)
if ran == false then
for t = 0, 7, 0.003 do
marker.Position = blueFairyCalc(t)
marker.Parent = workspace
end
ran = true
end
end
]]--
function createMarker(step)
if ran == false then
marker.Position = blueFairyCalc(t)
marker.Parent = workspace
local vector3 = Instance.new("Vector3Value")
vector3.Value = blueFairyCalc(t)
vector3.Name = t
vector3.Parent = ServerStorage.blueFairyVectors
t = t + 0.003
if t >= 7 then
ran = true
end
end
end
function blueFairyCalc(t)
if t < 1 then
return Vector3.new(0,0 + (-15 * t),0)
elseif t < 2 then
return curve:Calc(t - 1) - Vector3.new( 224, 232, -16 )
elseif t <= 7 then
return Vector3.new(0,0 + (-9 * t) ,0 + (30))
end
end
RunService.Heartbeat:Connect(createMarker)