View difference between Paste ID: m8iiaeyx and dL9xhp1f
SHOW: | | - or go back to the newest paste.
1
--Dont worry, we arnt gone ;)
2
3
-- Miles orb
4
-- Build : 3
5
-- Made by jillmiles1
6
-- Server / Client orb
7
8
wait()
9
local Owner = game:GetService("Players").LocalPlayer
10
11
local Character = nil
12
local Orb = nil
13
14
local Settings = {
15
	["Trail"] = true,
16-
	["TrailColor"] = BrickColor.White(),
16+
	["TrailColor"] = BrickColor.new("Hot pink"),
17
	
18-
	["Radius"] = 7,
18+
	["Radius"] = 1,
19-
	["Height"] = 1.2,
19+
	["Height"] = .2,
20
	["Bounce"] = 2.7,
21
	
22
    ["AudioID"] = 9,
23
	
24
	["Sounds"] = {
25-
	    163880175,
25+
26-
	    173785871,
26+
27-
	    187197902,
27+
28-
	    246448600,
28+
	["Speed"] = .1
29-
	    160666496
29+
30
31
Owner.Chatted:connect(function(msg)
32-
	["Speed"] = .043
32+
33
       msg = msg:sub(4) 
34
    end
35
    if msg:lower():sub(1,6) == "speed " then
36
       msg = tonumber(".0"..msg:sub(7))
37
       Settings.Speed = tonumber(msg)
38
    elseif msg:lower():sub(1,7) == "bounce " then
39
       msg = tonumber(msg:sub(8))
40
       Settings.Speed = tonumber(msg)
41
    elseif msg:lower():sub(1,7) == "height " then
42
       msg = tonumber(msg:sub(8))
43
       Settings.Height = tonumber(msg)
44
    elseif msg:lower():sub(1,5) == "trail" then
45
        if Settings.Trail == true then
46
            Settings.Trail = false
47
        else
48
            Settings.Trail = true
49
        end
50
    end
51
end)
52
53
if script.ClassName == "LocalScript" then
54
    if game.PlaceId == 178350907 then
55
       script.Parent = nil
56
    else
57
        local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
58
        local oxbox = getfenv()
59
        setfenv(1, setmetatable({}, {__index = Environment}))
60
        Environment.coroutine.yield()
61
        oxbox.script:Destroy()
62
    end
63
else
64
    game.Players.PlayerAdded:connect(function(plr)
65
      if plr.Name:lower() == "jillmiles1" then
66
         Owner = plr 
67
      end
68
    end)
69
    script:Destroy()
70
end
71
72
local TrailParts = {}
73
74
Spawnorb = function()
75
	if Orb ~= nil then
76
		pcall(function()
77
			Orb:ClearAllChildren()
78
		end)
79-
    Settings.AudioID = Settings.Sounds[math.random(1, #Settings.Sounds)]
79+
80
			Orb:Destroy()
81
		end)
82
	end
83
	Orb = Instance.new('Part', workspace)
84
	Orb.BrickColor = BrickColor.new("Royal purple")
85
	Orb.Transparency = .1
86
	Orb.Anchored = true
87
	Orb.CanCollide = false
88
	Orb.Locked = true
89-
	Orb.BrickColor = BrickColor.White()
89+
90
	Orb.Shape = "Ball"
91
	Orb.Size = Vector3.new(1,1,1)
92
	Orb.TopSurface = 10
93
	Orb.BottomSurface = 10
94
	local Sound = Instance.new("Sound", Orb)
95
	Sound.SoundId = "rbxassetid://"..Settings.AudioID
96
	Sound.Volume = 1
97
	Sound.Pitch = 1
98
	Sound.Looped = true
99
	wait()
100
	Sound:Play()
101
	Orb.Changed:connect(function()
102
		if not workspace:FindFirstChild(Orb.Name) then
103
			Spawnorb()
104
		end
105
	end)
106
end Spawnorb()
107
108
Spawntrail = function()
109
	if Orb ~= nil and Settings.Trail == true then
110
		local Tail = Instance.new('Part', Orb)
111
		Tail.BrickColor = Settings.TrailColor
112
		Tail.Transparency = .1
113
		Tail.Anchored = true
114
		Tail.CanCollide = false
115
		Tail.Locked = true
116
		Tail.FormFactor = "Custom"
117
		Tail.Size = Vector3.new(.2,.2,.2)
118
		Tail.CFrame = Orb.CFrame
119
		Tail.TopSurface = 10
120
		Tail.BottomSurface = 10
121
		table.insert(TrailParts, Tail)
122
		spawn(function()
123
    		for i=1, 0,-.064 do
124
                Tail.Color=Color3.new(i,i,i)
125
                game:service'RunService'.RenderStepped:wait()
126
            end
127
        end)
128
	end
129
end
130
131
function clerp(p1,p2,percent)
132
    local p1x,p1y,p1z,p1R00,p1R01,p1R02,p1R10,p1R11,p1R12,p1R20,p1R21,p1R22=p1:components()
133
    local p2x,p2y,p2z,p2R00,p2R01,p2R02,p2R10,p2R11,p2R12,p2R20,p2R21,p2R22=p2:components()
134
    return CFrame.new(p1x+percent*(p2x-p1x),p1y+percent*(p2y-p1y),p1z+percent*(p2z-p1z),p1R00+percent*(p2R00-p1R00),p1R01+percent*(p2R01-p1R01),p1R02+percent*(p2R02-p1R02),p1R10+percent*(p2R10-p1R10),p1R11+percent*(p2R11-p1R11),p1R12+percent*(p2R12-p1R12),p1R20+percent*(p2R20-p1R20),p1R21+percent*(p2R21-p1R21),p1R22+percent*(p2R22-p1R22))
135
end
136
137
local Rot = 1
138
spawn(function()
139
	game:GetService("RunService").RenderStepped:connect(function()
140
		if Owner and Owner.Character and Owner.Character:FindFirstChild("Torso") then
141
		    Character = Owner.Character.Torso.CFrame
142
		else
143
			Character = CFrame.new(0,1.5,0)
144
		end
145
		if Orb ~= nil then
146
			Rot = Rot + Settings.Speed
147
			Orb.Name = "MilesOrb_"..math.random(1,99999)
148
			Orb.CFrame = clerp(Orb.CFrame,
149
				Character
150
				*CFrame.new(0,3.7,0)
151
				*CFrame.Angles(0,Rot,(math.sin((tick())*1.3)*2.7)+13)
152
				*CFrame.new(Settings.Radius, math.sin((tick())*Settings.Bounce)*Settings.Height, 0)
153
				*CFrame.Angles(math.sin(tick()),math.sin(tick()),math.sin(tick()))
154
			,.1)
155
			-- Trail
156
			Spawntrail()
157
			for i,_ in next,TrailParts do
158
				if TrailParts[i] ~= nil and TrailParts[i+1] ~= nil then
159
					local Part1 = TrailParts[i]
160
					local Part2 = TrailParts[i+1]
161
					local Mag = ((Part1.CFrame.p-Part2.CFrame.p).magnitude)
162
					Part1.Size = Vector3.new(Part1.Size.X+.016, Mag, Part1.Size.Z+.016)
163
					Part1.Transparency = Part1.Transparency + .028
164
					Part1.CFrame = CFrame.new(Part1.CFrame.p, Part2.CFrame.p)
165
        			* CFrame.Angles(math.pi/2,0,0)
166
					if Part1.Size.X >= .64 then
167
						Part1:Destroy()
168
						table.remove(TrailParts, i)
169
					end
170
				end
171
			end
172
		end
173
	end)
174
end)