End_Wolf

Untitled

Jun 20th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.82 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. LocalScript1 = Instance.new("LocalScript")
  21. MeshPart2 = Instance.new("MeshPart")
  22. LocalScript3 = Instance.new("LocalScript")
  23. ModuleScript4 = Instance.new("ModuleScript")
  24. Configuration5 = Instance.new("Configuration")
  25. NumberValue6 = Instance.new("NumberValue")
  26. NumberValue7 = Instance.new("NumberValue")
  27. BoolValue8 = Instance.new("BoolValue")
  28. NumberValue9 = Instance.new("NumberValue")
  29. NumberValue10 = Instance.new("NumberValue")
  30. Sound11 = Instance.new("Sound")
  31. LocalScript12 = Instance.new("LocalScript")
  32. Camera13 = Instance.new("Camera")
  33. Tool0.Name = "Portal Gun"
  34. Tool0.Parent = mas
  35. Tool0.Grip = CFrame.new(-0.63109529, 0.452967376, -0.402335078, 0.994709015, 0.000125572755, 0.102732286, 0.102732286, 1.29689943e-05, -0.994709015, -0.000126240688, 1, 0)
  36. Tool0.GripForward = Vector3.new(-0.102732286, 0.994709015, -0)
  37. Tool0.GripPos = Vector3.new(-0.63109529, 0.452967376, -0.402335078)
  38. Tool0.GripRight = Vector3.new(0.994709015, 0.102732286, -0.000126240688)
  39. Tool0.GripUp = Vector3.new(0.000125572755, 1.29689943e-05, 1)
  40. LocalScript1.Name = "AnimateScript(EM-500)"
  41. LocalScript1.Parent = Tool0
  42. table.insert(cors,sandbox(LocalScript1,function()
  43. local MOUSE_ICON = 'rbxassetid://120192974' local Tool = script.Parent
  44. local Mouse = nil local function UpdateIcon()
  45. if Mouse then Mouse.Icon = Tool.Enabled and MOUSE_ICON end end local function OnEquipped(mouse) Mouse = mouse UpdateIcon() end local function OnChanged(property)
  46. if property == 'Enabled' then UpdateIcon() end end Tool.Equipped:connect(OnEquipped) Tool.Changed:connect(OnChanged)
  47.  
  48. local arms = nil
  49. local torso = nil
  50. local welds = {}
  51. local Tool = script.Parent
  52. local neck = nil
  53. local orginalC0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  54.  
  55. function Equip(mouse)
  56. wait(0.01)
  57. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  58. head = Tool.Parent:FindFirstChild("Head")
  59. torso = Tool.Parent:FindFirstChild("Torso")
  60. if neck == nil then
  61. neck = Tool.Parent:FindFirstChild("Torso").Neck
  62. end
  63. if arms ~= nil and torso ~= nil then
  64. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  65. if sh ~= nil then
  66. local yes = true
  67. if yes then
  68. yes = false
  69. sh[1].Part1 = nil
  70. sh[2].Part1 = nil
  71. local weld1 = Instance.new("Weld")
  72. weld1.Part0 = head
  73. weld1.Parent = head
  74. weld1.Part1 = arms[1]
  75. welds[1] = weld1
  76. local weld2 = Instance.new("Weld")
  77. weld2.Part0 = head
  78. weld2.Parent = head
  79. weld2.Part1 = arms[2]
  80. welds[2] = weld2
  81. -------------------------here
  82. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  83. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  84. mouse.Move:connect(function ()
  85. --local Direction = Tool.Direction.Value
  86. local Direction = mouse.Hit.p
  87. local b = head.Position.Y-Direction.Y
  88. local dist = (head.Position-Direction).magnitude
  89. local answer = math.asin(b/dist)
  90. neck.C0=orginalC0*CFrame.fromEulerAnglesXYZ(answer,0,0)
  91. wait(0.1)
  92. end)end
  93. else
  94. print("sh")
  95. end
  96. else
  97. print("arms")
  98. end
  99. end
  100.  
  101. function Unequip(mouse)
  102. if arms ~= nil and torso ~= nil then
  103. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  104. if sh ~= nil then
  105. local yes = true
  106. if yes then
  107. yes = false
  108. neck.C0 = orginalC0
  109.  
  110. sh[1].Part1 = arms[1]
  111. sh[2].Part1 = arms[2]
  112. welds[1].Parent = nil
  113. welds[2].Parent = nil
  114. end
  115. else
  116. print("sh")
  117. end
  118. else
  119. print("arms")
  120. end
  121. end
  122. Tool.Equipped:connect(Equip)
  123. Tool.Unequipped:connect(Unequip)
  124.  
  125. function Animate()
  126. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  127. if Tool.AnimateValue.Value == "Shoot" then
  128. local weld1 = welds[1]
  129. local weld2 = welds[2]
  130. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  131. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  132. wait(0.00001)
  133. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.05, math.rad(-90))
  134. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  135. wait(0.00001)
  136. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.1, math.rad(-90))
  137. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0)
  138. wait(0.00001)
  139. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.3, math.rad(-90))
  140. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0)
  141. wait(0.00001)
  142. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.35, math.rad(-90))
  143. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0)
  144. wait(0.00001)
  145. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  146. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  147. wait(0.00001)
  148. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  149. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  150. Tool.AnimateValue.Value = "None"
  151. end
  152. if Tool.AnimateValue.Value == "Reload" then
  153. local weld1 = welds[1]
  154. local weld2 = welds[2]
  155. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  156. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  157. wait(0.0001)
  158. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  159. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  160. wait(0.0001)
  161. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  162. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-95), math.rad(-15), 0)
  163. wait(0.0001)
  164. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  165. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-100), math.rad(-15), 0)
  166. wait(0.0001)
  167. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  168. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-105), math.rad(-15), 0)
  169. wait(0.0001)
  170. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  171. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0)
  172. wait(0.0001)
  173. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.4, math.rad(-90))
  174. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-115), math.rad(-15), 0)
  175. wait(0.0001)
  176. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.45, math.rad(-90))
  177. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  178. wait(0.0001)
  179. weld1.C1 = CFrame.new(-0.5+1.5, 0.9, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.5, math.rad(-90))
  180. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  181. wait(0.0001)
  182. weld1.C1 = CFrame.new(-0.5+1.5, 1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.55, math.rad(-90))
  183. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  184. wait(0.0001)
  185. weld1.C1 = CFrame.new(-0.5+1.5, 1.1, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.57, math.rad(-90))
  186. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  187. wait(0.0001)
  188. weld1.C1 = CFrame.new(-0.5+1.5, 1.2, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90))
  189. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  190. wait(0.0001)
  191. weld1.C1 = CFrame.new(-0.5+1.5, 1.3, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0.6, math.rad(-90))
  192. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-120), math.rad(-15), 0)
  193. wait(0.0001)
  194. weld1.C1 = CFrame.new(-0.5+1.5, 0.8, .9)* CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  195. weld2.C1 = CFrame.new(-1, 0.8, 0.5-1.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  196. Tool.AnimateValue.Value = "None"
  197. end
  198. end
  199.  
  200. Tool.AnimateValue.Changed:connect(Animate)
  201.  
  202. end))
  203. MeshPart2.Name = "Handle"
  204. MeshPart2.Parent = Tool0
  205. MeshPart2.CFrame = CFrame.new(9.15849304, 1.12624502, 3.90480328, 9.90927219e-07, 1.00000727, -1.79058759e-06, -1.51428281e-07, -1.98858993e-06, 1.00000024, 0.999996245, 8.86619091e-07, -2.49169943e-07)
  206. MeshPart2.Orientation = Vector3.new(-90, -90, 0)
  207. MeshPart2.Position = Vector3.new(9.15849304, 1.12624502, 3.90480328)
  208. MeshPart2.Rotation = Vector3.new(-90, 0, -90)
  209. MeshPart2.Size = Vector3.new(2.19040489, 4.31696177, 2.25249791)
  210. MeshPart2.CanCollide = false
  211. MeshPart2.TextureID = "rbxassetid://430056584"
  212. LocalScript3.Parent = Tool0
  213. table.insert(cors,sandbox(LocalScript3,function()
  214. local tool = script.Parent
  215. local debris = game:GetService("Debris")
  216. local timestart = false
  217. local timer = 0
  218. local model = Instance.new("Model",game.Workspace)
  219. local colora = BrickColor.new(Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255))
  220. local colorb = BrickColor.new(Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255))
  221. print(colora)
  222. print(colorb)
  223. tool:WaitForChild("Settings")
  224. local pp = script.Parent.Settings.PortalPower
  225. local cw = script.Parent.Settings.CameraWait
  226. local cg --[[;^)]] = script.Parent.Settings.CanGrab
  227. local gp = script.Parent.Settings.GrabPower
  228. local gr = script.Parent.Settings.GrabRange
  229. script.Parent:WaitForChild("surface")
  230. funcs = require(script.Parent.surface)
  231.  
  232. function gpos(part,pos,ignore)
  233. local r = Ray.new(part.Position,(pos-part.Position).unit*999)
  234. return workspace:FindPartOnRayWithIgnoreList(r,ignore)
  235. end
  236.  
  237. tool.Equipped:connect(function (mouse)
  238. script.Parent.Handle.Anchored = false
  239. local player = game.Players.LocalPlayer
  240. local grabbed_object = nil
  241. model.Name = player.Name.."'s Portals"
  242. local canTeleport = true
  243.  
  244. function getModelMass(model)
  245. if model == nil then return 0 end
  246. local mass = 0
  247. local function getModelMass(m)
  248. for i,v in pairs(m:GetChildren()) do
  249. if v:IsA("BasePart") then
  250. mass = mass + v:GetMass()
  251. elseif v:IsA("Model") then
  252. getModelMass(v)
  253. end
  254. end
  255. end
  256. getModelMass(model)
  257. return mass
  258. end
  259.  
  260. function telePortal(hit, blue)
  261. if hit == grabbed_object then
  262. grabbed_object.Grab:Destroy()
  263. grabbed_object = nil
  264. end
  265. if model:findFirstChild("BluePortal") and model:findFirstChild("RedPortal") then
  266. if hit.Parent and hit.Parent ~= workspace and hit.Anchored == false then
  267. if getModelMass(hit.Parent) > 60 then return else
  268. if hit.Parent:findFirstChild("Torso") then
  269. hit = hit.Parent.Torso
  270. end
  271. end
  272. else
  273. if hit:getMass() > 60 or hit.Anchored then return end
  274. end
  275.  
  276. local this
  277. local other
  278.  
  279. if blue then
  280. this = model.BluePortal
  281. other = model.RedPortal
  282. else
  283. this = model.RedPortal
  284. other = model.BluePortal
  285. end
  286.  
  287. local x = math.abs(hit.Velocity.x)
  288. local y = math.abs(hit.Velocity.y)
  289. local z = math.abs(hit.Velocity.z)
  290.  
  291. local main = 0
  292. if x > y and x > z then
  293. main = x
  294. elseif y > x and y > z then
  295. main = y
  296. elseif z > x and z > y then
  297. main = z
  298. end
  299. main = math.ceil(main)
  300. local dir = other.CFrame.lookVector
  301. local spawn = other.CFrame.p + (dir*3)
  302. hit.CFrame = CFrame.new(spawn, spawn+dir*2)
  303. hit.Velocity = dir*main*pp.Value
  304. end
  305. end
  306.  
  307. function makePortal(pos, hit, blue)
  308. local p = Instance.new("Part", model)
  309. if blue then p.Name = "BluePortal" else p.Name = "RedPortal" end
  310. if blue then p.BrickColor = colora else p.BrickColor = colorb end
  311. p.Material = Enum.Material.Neon
  312. p.FormFactor = Enum.FormFactor.Custom
  313. p.Size = Vector3.new(4,6,3)
  314. p.TopSurface = 0
  315. p.BottomSurface = 0
  316. p.Anchored = true
  317. local p2 = Instance.new("Part", model)
  318. p2.Size = Vector3.new(0.2,0.2,0.2)
  319. p2.CanCollide = false
  320. p2.TopSurface = 0
  321. p2.BottomSurface = 0
  322. p2.BrickColor = p.BrickColor
  323. if blue then
  324. p2.Name = "BP"
  325. else
  326. p2.Name = "RP"
  327. end
  328. local sm2 = Instance.new("SpecialMesh", p2)
  329. sm2.Scale = Vector3.new(0.45, 0.3, 0.0018)
  330. sm2.MeshId = "rbxassetid://431119824"
  331. local sm = Instance.new("SpecialMesh",p)
  332. sm.MeshType = "Sphere"
  333. sm.Scale = Vector3.new(1,1,0.01)
  334. p.CanCollide = false
  335. local dir = funcs.getSide(hit,funcs.surface(hit,pos))
  336. p.CFrame = CFrame.new(pos, pos + dir)
  337. p2.CFrame = p.CFrame * CFrame.Angles(0,0,math.pi/2)
  338. funcs.weld(p2,p)
  339. if hit.Anchored == false then
  340. local pos = p.CFrame:inverse() * hit.CFrame
  341. funcs.weld(p,hit)
  342. p.Anchored = false
  343. p.ChildRemoved:connect(function (c)
  344. if c.Name == "Weld" then
  345. p:Destroy()
  346. p2:Destroy()
  347. end
  348. end)
  349. end
  350. p.Touched:connect(funcs.debounce(function (h) if canTeleport then canTeleport = false telePortal(h,blue) wait(.1) canTeleport = true end end))
  351. end
  352.  
  353. function firePortal(origin,dir,blue,chit,target)
  354. local p = Instance.new("Part", game.Workspace)
  355. p.FormFactor = Enum.FormFactor.Custom
  356. p.Size = Vector3.new(.1,.1,.1)
  357. p.TopSurface = 0
  358. p.BottomSurface = 0
  359. if blue then
  360. p.BrickColor = colora
  361. else
  362. p.BrickColor = colorb
  363. end
  364. p.Material = Enum.Material.Neon
  365. local sm = Instance.new("SpecialMesh",p)
  366. sm.MeshType = "Sphere"
  367. sm.Scale = Vector3.new(10,10,10)
  368. p.Reflectance = 1
  369. local bf = Instance.new("BodyForce",p)
  370. bf.force = Vector3.new(0,196.2,0)*p:GetMass()
  371. p.Velocity = dir*200
  372. p.CFrame = CFrame.new(origin,origin+dir)
  373. p:BreakJoints()
  374. tool.Fire:Play()
  375. funcs.debounce(p.Touched:connect(function (h)
  376. if blue and target then
  377. if model:FindFirstChild("BluePortal") then model.BluePortal:Destroy() end
  378. if model:FindFirstChild("BP") then model.BP:Destroy() end
  379. makePortal(chit,target,true)
  380.  
  381. elseif not blue and target then
  382. if model:FindFirstChild("RedPortal") then model.RedPortal:Destroy() end
  383. if model:FindFirstChild("RP") then model.RP:Destroy() end
  384. makePortal(chit,target,false)
  385. end
  386. p:Destroy()
  387. end))
  388. debris:AddItem(p,120)
  389. end
  390.  
  391. funcs.debounce(mouse.Button2Down:connect(function ()
  392. timestart = false
  393. wait(cw.Value)
  394. timestart = true
  395. end))
  396.  
  397. funcs.debounce(mouse.Button1Down:connect(function ()
  398. local dir = (mouse.Hit.p - player.Character.Head.Position).unit
  399. local origin = player.Character.Head.Position + dir*5
  400. local block, pos = gpos(tool.Handle,mouse.Hit.p,{tool.Parent,model,grabbed_object})
  401. firePortal(origin,dir,true,pos,block)
  402. end))
  403.  
  404. funcs.debounce(mouse.Button2Up:connect(function ()
  405. if timestart then return end
  406. local dir = (mouse.Hit.p - player.Character.Head.Position).unit
  407. local origin = player.Character.Head.Position + dir*5
  408. local block, pos = gpos(tool.Handle,mouse.Hit.p,{tool.Parent,model,grabbed_object})
  409. firePortal(origin,dir,false,pos,block)
  410. end))
  411.  
  412. funcs.debounce(mouse.KeyDown:connect(function (k)
  413. local mt = mouse.Target
  414. if mt then
  415. if k == "e" and cg.Value then
  416. if grabbed_object == nil and (mt.Position - tool.Handle.Position).magnitude < gr.Value then
  417. if mt:getMass() > gp.Value then return end
  418. mt.CFrame = tool.Handle.CFrame * CFrame.new(0,6,0)
  419. local w = funcs.weld(mt, tool.Handle)
  420. w.Name = "Grab"
  421. grabbed_object = mt
  422. elseif grabbed_object then
  423. grabbed_object.Grab:Destroy()
  424. grabbed_object.Velocity = tool.Parent.Torso.CFrame.lookVector*100
  425. grabbed_object = nil
  426. end
  427. end
  428. end
  429.  
  430. if k == "r" then
  431. model:ClearAllChildren()
  432. end
  433. end))
  434.  
  435. local event = workspace.ChildRemoved:connect(function (c)
  436. if c == model then
  437. model = Instance.new("Model", workspace)
  438. model.Name = player.Name.."'s Portals"
  439. end
  440. end)
  441.  
  442. player.Character.Humanoid.Died:connect(function ()
  443. event:disconnect()
  444. model:Destroy()
  445. end)
  446. end)
  447.  
  448. tool.Unequipped:connect(function ()
  449. if tool.Parent == game.Workspace then
  450. model:Destroy()
  451. model = Instance.new("Model", workspace)
  452. end
  453. end)
  454. end))
  455. ModuleScript4.Name = "surface"
  456. ModuleScript4.Parent = Tool0
  457. table.insert(cors,sandbox(ModuleScript4,function()
  458. local module = {}
  459.  
  460. --vvv Made by Anaminus vvv---
  461. local function NumNormal(n)
  462. return n == 0 and 0 or n/math.abs(n)
  463. end
  464.  
  465. function module.surface(part,point)
  466. local p = part.CFrame:toObjectSpace(CFrame.new(point)).p
  467. local s = part.Size
  468. local ax,ay,az = math.abs(p.x/s.x),math.abs(p.y/s.y),math.abs(p.z/s.z)
  469. return Vector3.new(NumNormal(p.x),NumNormal(p.y),NumNormal(p.z)) * Vector3.new(
  470. (ax>ay and ax>az) and 1 or 0,
  471. (ay>ax and ay>az) and 1 or 0,
  472. (az>ax and az>ay) and 1 or 0
  473. )
  474. end
  475. --^^^ Made by Anaminus ^^^---
  476.  
  477. function module.getSide(p,s)
  478. local cf = p.CFrame
  479. if s.x > 0 then
  480. return (cf*CFrame.fromAxisAngle(Vector3.new(0,-1,0),math.pi/2)).lookVector
  481. elseif s.x < 0 then
  482. return (cf*CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/2)).lookVector
  483. end
  484.  
  485. if s.y < 0 then
  486. return (cf*CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/2)).lookVector
  487. elseif s.y > 0 then
  488. return (cf*CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/2)).lookVector
  489. end
  490.  
  491. if s.z < 0 then
  492. return cf.lookVector
  493. elseif s.z > 0 then
  494. return -cf.lookVector
  495. end
  496. end
  497.  
  498. function module.debounce(func)
  499. local debounce = false
  500. return function(...)
  501. if not debounce then
  502. debounce = true
  503. func(...)
  504. debounce = false
  505. end
  506. end
  507. end
  508.  
  509. function module.part(p)
  510. local parts = {}
  511. local function getParts(m)
  512. for _,v in pairs(m:GetChildren()) do
  513. if v:IsA("Part") and v ~= p then
  514. table.insert(parts,#parts+1,v)
  515. elseif v:IsA("Model") then
  516. getParts(v)
  517. end
  518. end
  519. end
  520. getParts(game.Workspace)
  521. local winner = {}
  522. for _,q in pairs(parts) do
  523. local mag = (q.Position-p.Position).magnitude
  524. if mag < winner[1] then
  525. winner[1] = mag
  526. winner[2] = q
  527. end
  528. end
  529. return winner[2]
  530. end
  531.  
  532. function module.weld(p1,p2)
  533. local w = Instance.new("Weld")
  534. w.Part0 = p1
  535. w.Part1 = p2
  536. w.C0 = p1.CFrame:inverse() * p2.CFrame
  537. w.Parent = p1
  538. return w
  539. end
  540. return module
  541. end))
  542. Configuration5.Name = "Settings"
  543. Configuration5.Parent = Tool0
  544. NumberValue6.Name = "PortalPower"
  545. NumberValue6.Parent = Configuration5
  546. NumberValue6.Value = 1
  547. NumberValue7.Name = "CameraWait"
  548. NumberValue7.Parent = Configuration5
  549. NumberValue7.Value = 0.65
  550. BoolValue8.Name = "CanGrab"
  551. BoolValue8.Parent = Configuration5
  552. BoolValue8.Value = true
  553. NumberValue9.Name = "GrabPower"
  554. NumberValue9.Parent = Configuration5
  555. NumberValue9.Value = 100
  556. NumberValue10.Name = "GrabRange"
  557. NumberValue10.Parent = Configuration5
  558. NumberValue10.Value = 5
  559. Sound11.Name = "Fire"
  560. Sound11.Parent = Tool0
  561. Sound11.SoundId = "rbxassetid://142774034"
  562. LocalScript12.Name = "MouseIcon"
  563. LocalScript12.Parent = Tool0
  564. table.insert(cors,sandbox(LocalScript12,function()
  565. local MOUSE_ICON = 'rbxassetid://120192974' local Tool = script.Parent
  566. local Mouse = nil local function UpdateIcon()
  567. if Mouse then Mouse.Icon = Tool.Enabled and MOUSE_ICON end end local function OnEquipped(mouse) Mouse = mouse UpdateIcon() end local function OnChanged(property)
  568. if property == 'Enabled' then UpdateIcon() end end Tool.Equipped:connect(OnEquipped) Tool.Changed:connect(OnChanged)
  569.  
  570. end))
  571. LocalScript12.Disabled = true
  572. Camera13.Name = "ThumbnailCamera"
  573. Camera13.Parent = Tool0
  574. Camera13.CFrame = CFrame.new(-122.698433, 1.56488907, 9.07953835, -0.740325332, -0.0495854728, 0.670417547, -0, 0.997275949, 0.0737605989, -0.672248781, 0.05460684, -0.738308668)
  575. Camera13.CoordinateFrame = CFrame.new(-122.698433, 1.56488907, 9.07953835, -0.740325332, -0.0495854728, 0.670417547, -0, 0.997275949, 0.0737605989, -0.672248781, 0.05460684, -0.738308668)
  576. Camera13.FieldOfView = 29.999997769916
  577. Camera13.Focus = CFrame.new(-124.039268, 1.41736782, 10.5561562, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  578. Camera13.focus = CFrame.new(-124.039268, 1.41736782, 10.5561562, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  579. for i,v in pairs(mas:GetChildren()) do
  580. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  581. pcall(function() v:MakeJoints() end)
  582. end
  583. mas:Destroy()
  584. for i,v in pairs(cors) do
  585. spawn(function()
  586. pcall(v)
  587. end)
  588. end
Add Comment
Please, Sign In to add comment