Advertisement
vL4d_4eVer

d

Oct 19th, 2018
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.23 KB | None | 0 0
  1. local tweens = game:GetService("TweenService")
  2. local debrs = game:GetService("Debris")
  3.  
  4. local ins = Instance.new
  5. local v3 = Vector3.new
  6. local cf = CFrame.new
  7. local angles = CFrame.Angles
  8. local rad = math.rad
  9. local huge = math.huge
  10. local cos = math.cos
  11. local sin = math.sin
  12. local tan = math.tan
  13. local ray = Ray.new
  14. local random = math.random
  15. local ud = UDim.new
  16. local ud2 = UDim2.new
  17. local c3 = Color3.new
  18. local rgb = Color3.fromRGB
  19. local bc = BrickColor.new
  20.  
  21. local platformWidth = 50
  22. local platfromHeight = 5
  23. local cfpos = cf(0,200,1500)*cf(0,platfromHeight/2,0)
  24. local bcf = cf(30,0,-30)
  25. local material = "Cobblestone"
  26. local colors = {"Dark green","Black","Tr. Green","Earth green","Parsley green","Shamrock"}
  27. local start = true
  28. local endd = false
  29. local curcolor
  30. local startp
  31. local hitboxparts = {}
  32.  
  33. local directions = {In = Enum.EasingDirection.In,
  34.     Out = Enum.EasingDirection.Out,
  35.     InOut = Enum.EasingDirection.InOut
  36. }
  37. local styles = {Linear = Enum.EasingStyle.Linear,
  38.     Back = Enum.EasingStyle.Back,
  39.     Bounce = Enum.EasingStyle.Bounce,
  40.     Sine = Enum.EasingStyle.Sine,
  41.     Quad = Enum.EasingStyle.Quad,
  42.     Elastic = Enum.EasingStyle.Elastic,
  43.     Quart = Enum.EasingStyle.Quart,
  44.     Quint = Enum.EasingStyle.Quint
  45. }
  46.  
  47. local mod = ins("Model",script)
  48.  
  49. local tlerp = function(part,tablee,leinght,easingstyle,easingdirec)
  50.     local info = TweenInfo.new(
  51.     leinght,
  52.     easingstyle,
  53.     easingdirec,
  54.     0,
  55.     false,
  56.     0
  57.     )
  58.     local lerp = tweens:Create(part,info,tablee)
  59.     lerp:Play()
  60. end
  61. function sound(parent,id,vol,pitch)
  62. pcall(function()
  63. local sound = Instance.new("Sound",parent)
  64. sound.Volume = vol
  65. sound.SoundId = "rbxassetid://"..id
  66. sound.Pitch = pitch
  67. sound:Play()
  68. coroutine.resume(coroutine.create(function()
  69. repeat
  70. wait()
  71. until sound.Playing == false
  72. sound:Destroy()
  73. end))
  74. end)
  75. end
  76. function lesserfirepart(parttofire)
  77.     coroutine.resume(coroutine.create(function()
  78.         for i = 1,random(6,12) do
  79.             if not parttofire or not parttofire.Parent then
  80.                 break
  81.             end
  82.                 damagingfire(parttofire,effects,"Maroon","Deep orange",math.random(5,9)/5,math.random(2,5)/5,math.random(6,10)/12,"Neon",2,6,"Block",3,0,0,true,random(1,2))
  83.             wait(.25)
  84.             end
  85.     end))
  86. end
  87. function damagingfire(partp,parent,color1,color2,ssize,osize,leinght,material,minr,maxr,shape,spread,st,ot,onlyraise,damage)
  88.     local deb = false
  89.     local part = Instance.new("Part",parent) part.Size = Vector3.new(ssize,ssize,ssize) part.Transparency = st part.CanCollide = false part.Anchored = true part.Shape = shape part.Material = material part.BrickColor = BrickColor.new(color1) part.CFrame = partp.CFrame * CFrame.new(partp.Size.x/math.random(-20,20),partp.Size.y/math.random(-20,20),partp.Size.z/math.random(-20,20))
  90.     part.Name="FireP"
  91.     if onlyraise == true then
  92.         part.CFrame = CFrame.new(part.CFrame.p,Vector3.new(part.Position.y,part.CFrame.y,part.CFrame.z))
  93.     end
  94.     part.Touched:Connect(function(hit)
  95.         if not deb then
  96.             local newhum = hit.Parent:FindFirstChildOfClass("Humanoid")
  97.             if newhum and newhum ~= hum then
  98.                 deb = false
  99.                 local rand = random(1,6)
  100.                 if rand == 3 then
  101.                     lesserfirepart(hit)
  102.                 end
  103.                 newhum.Health = newhum.Health -damage
  104.             end
  105.         end
  106.     end)
  107.     local pcf = part.CFrame
  108.     tlerp(part,{CFrame = pcf * CFrame.new(math.random(-spread,spread)/math.random(2,4),math.random(minr,maxr),math.random(-spread,spread)/math.random(2,4)) * CFrame.Angles(rad(math.random(-180,180)),rad(math.random(-180,180)),rad(math.random(-180,180))),Size = Vector3.new(osize,osize,osize),Color = BrickColor.new(color2).Color,Transparency = ot},leinght,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut)
  109.     game:GetService("Debris"):AddItem(part,leinght)
  110. end
  111. function msg(text,time)
  112. local msg = ins("Hint",workspace)
  113. msg.Text = text
  114. game:GetService("Debris"):AddItem(msg,time)
  115. end
  116. function maketorch(pos,face)
  117.     local p = ins("Part",mod)
  118.     p.Material = "Wood"
  119.     p.BrickColor = bc("Brown")
  120.     p.Anchored = true
  121.     p.Size = v3(.02,.06,.02)*platformWidth
  122.     p.CFrame = pos
  123.     local oldp = p
  124.     local p = ins("Part",mod)
  125.     p.Material = "Neon"
  126.     p.BrickColor = bc("CGA brown")
  127.     p.Anchored = true
  128.     p.Size = v3(.0225,.0225,.0225)*platformWidth
  129.     p.CFrame = oldp.CFrame*cf(0,oldp.Size.y/2+p.Size.y/2,0)
  130.     local light = ins("SurfaceLight",p)
  131.     light.Face = face
  132.     light.Color = p.Color
  133.     light.Angle = 180
  134.     light.Range = 35
  135.     light.Brightness = 2.5
  136. end
  137. function tooltorch(who)
  138.     local tool = ins("Tool")
  139.     tool.Name = "Torch"
  140.     local p = ins("Part",tool)
  141.     p.Material = "Wood"
  142.     p.BrickColor = bc("Brown")
  143.     p.Anchored = false
  144.     p.CanCollide = false
  145.     p.Size = v3(.35,1.5,.35)
  146.     p.Name = "Handle"
  147.     p.CFrame = cf(0,1000,0)
  148.     local oldp = p
  149.     local p = ins("Part",oldp)
  150.     p.Material = "Neon"
  151.     p.BrickColor = bc("CGA brown")
  152.     p.Anchored = false
  153.     p.CanCollide = false
  154.     p.Size = v3(.425,.425,.425)
  155.     p.CFrame = oldp.CFrame*cf(0,oldp.Size.y/2+p.Size.y/2,0)
  156.     local weld = ins("WeldConstraint",oldp)
  157.     weld.Part0 = oldp
  158.     weld.Part1 = p
  159.     local light = ins("SurfaceLight",p)
  160.     light.Face = "Front"
  161.     light.Color = p.Color
  162.     light.Angle = 180
  163.     light.Range = 20
  164.     light.Brightness = 4
  165.     local light = ins("SurfaceLight",p)
  166.     light.Face = "Back"
  167.     light.Color = p.Color
  168.     light.Angle = 180
  169.     light.Range = 20
  170.     light.Brightness = 4
  171.     tool.Parent = who
  172. end
  173. function maketrap(pos)
  174.     local p = ins("Part",mod)
  175.     p.Material = "Slate"
  176.     p.BrickColor = bc("Darkgrey")
  177.     p.Anchored = true
  178.     p.Size = v3(.15,.25,.15)*platformWidth
  179.     p.CFrame = pos
  180.     p.CanCollide = false
  181.     p.Name="Fire"
  182.     local msh = ins("BlockMesh",p)
  183.     msh.Scale = v3(.25,.01,.25)
  184.     local deb = false
  185.     p.Touched:Connect(function(hit)
  186.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  187.         if hum and not deb then
  188.             deb = true
  189.             sound(p,158853971,10,15)
  190.             for i = 1,random(5,8) do
  191.                 damagingfire(p,mod,"Maroon","Deep orange",(math.random(6,10)/50)*platformWidth/2.5,.01,math.random(6,10)/10,"Neon",2*platformWidth/10,4*platformWidth/10,"Block",3,0,0,false,random(3,6))
  192.                 wait()
  193.             end
  194.             wait(3.5)
  195.             deb = false
  196.         end
  197.     end)
  198. end
  199. function rayc(spos,direc,ignore,dist)
  200.     local rai = ray(spos,direc.Unit * dist)
  201.     local rhit,rpos,rrot = workspace:FindPartOnRayWithIgnoreList(rai,ignore,false,false)
  202.     return rhit,rpos,rrot
  203. end
  204. function createPlatform(cfr)
  205.     local plat = ins("Part",mod)
  206.     plat.Anchored = true
  207.     plat.Size = v3(platformWidth,platfromHeight,platformWidth)
  208.     plat.CFrame = cfr
  209.     plat.Material = material
  210.     curcolor = bc(colors[random(1,#colors)])
  211.     local rannum = random(1,2)
  212.     if rannum == 2 and not start then
  213.         local xa = random(-10,10)
  214.         local za = random(-10,10)
  215.         if xa == 1 then
  216.             xa = 2
  217.         elseif xa == -1 then
  218.             xa = -2
  219.         end
  220.         if za == 1 then
  221.             za = 2
  222.         elseif za == -1 then
  223.             za = -2
  224.         end
  225.         maketrap(plat.CFrame*cf(xa,plat.Size.y/2,za),tostring(plat.BrickColor))
  226.     end
  227.     if start then
  228.         plat.BrickColor = bc("Camo")
  229.         local light = ins("SurfaceLight",plat)
  230.         light.Face = "Top"
  231.         light.Color = plat.Color
  232.         light.Angle = 180
  233.         light.Range = plat.Size.z
  234.         light.Brightness = 2
  235.         local backb = ins("Part",plat)
  236.         backb.Anchored = true
  237.         backb.CanCollide = false
  238.         backb.Material = "Neon"
  239.         backb.BrickColor = bc("CGA brown")
  240.         backb.Size = v3(.1,.15,.1)*platformWidth
  241.         backb.CFrame = plat.CFrame * cf(plat.Size.x/3,plat.Size.y/2+backb.Size.y/2,plat.Size.z/3)
  242.         backb.Transparency = .5
  243.         local p = ins("Part",plat)
  244.         p.Material = "Neon"
  245.         p.BrickColor = bc("CGA brown")
  246.         p.Anchored = true
  247.         p.Size = v3(.025,.025,.025)*platformWidth
  248.         p.CFrame = plat.CFrame * cf(-plat.Size.x/7.5,(plat.Size.y/2)+p.Size.y/2,-plat.Size.z/7.5)
  249.         p.CanCollide = false
  250.         p.Transparency = .5
  251.         local billb = ins("BillboardGui",mod)
  252.         billb.Adornee = p
  253.         billb.StudsOffset = Vector3.new(0,backb.Size.y/1.5,0)
  254.         billb.Size = UDim2.new(4.5,0,1.5,0)
  255.         billb.AlwaysOnTop = true
  256.         billb.MaxDistance = 20
  257.         local l = Instance.new("TextBox",billb)
  258.         l.Size = UDim2.new(1,0,1,0)
  259.         l.BorderSizePixel = 0
  260.         l.BackgroundTransparency = 1
  261.         l.TextScaled = true
  262.         l.Text = "Click to get the torch"
  263.         l.TextColor = bc("CGA brown")
  264.         l.Rotation = 0
  265.         l.TextStrokeTransparency = 0
  266.         l.TextStrokeColor3 = bc("CGA brown").Color
  267.         local cld = ins("ClickDetector",p)
  268.         cld.MouseClick:Connect(function(plr)
  269.         tooltorch(plr.Backpack)
  270.         end)
  271.         local billb = ins("BillboardGui",mod)
  272.         billb.Adornee = backb
  273.         billb.StudsOffset = Vector3.new(0,backb.Size.y/1.5,0)
  274.         billb.Size = UDim2.new(4.5,0,1.5,0)
  275.         billb.AlwaysOnTop = true
  276.         billb.MaxDistance = 20
  277.         local l = Instance.new("TextBox",billb)
  278.         l.Size = UDim2.new(1,0,1,0)
  279.         l.BorderSizePixel = 0
  280.         l.BackgroundTransparency = 1
  281.         l.TextScaled = true
  282.         l.Text = "Touch this part to get back to the baseplate"
  283.         l.TextColor = bc("CGA brown")
  284.         l.Rotation = 0
  285.         l.TextStrokeTransparency = 0
  286.         l.TextStrokeColor3 = bc("CGA brown").Color
  287.         backb.Touched:Connect(function(hit)
  288.             local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  289.             if hum then
  290.                 local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
  291.                 if rut then
  292.                     rut.CFrame = cf(0,3,0)
  293.                 end
  294.             end
  295.         end)
  296.     elseif endd then
  297.         plat.BrickColor = curcolor
  298.     elseif not start and not endd then
  299.         plat.BrickColor = curcolor
  300.     end
  301.     local cfs = {
  302.         plat.CFrame *cf(plat.Size.x+0/5,0,0),
  303.         plat.CFrame *cf(-plat.Size.x-0/5,0,0),
  304.         plat.CFrame *cf(0,0,plat.Size.z+0/5),
  305.         plat.CFrame *cf(0,0,-plat.Size.z-0/5)
  306.         }
  307.     if endd then
  308.         local rew = ins("Part",plat)
  309.         rew.Anchored = true
  310.         rew.Material = "Glass"
  311.         rew.BrickColor = bc("Gold")
  312.         rew.Size = v3(.05,.05,.05)*platformWidth
  313.         rew.CFrame = plat.CFrame * cf(0,(rew.Size.y/2)+plat.Size.y/2,0)
  314.         rew.Name = random(-999999,999999)
  315.         print(rew.Name)
  316.         local light = ins("SurfaceLight",rew)
  317.         light.Face = "Top"
  318.         light.Color = rew.Color
  319.         light.Angle = 180
  320.         light.Range = 30
  321.         light.Brightness = 3
  322.         local deb = false
  323.         rew.Touched:Connect(function(hit)
  324.             local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  325.             if hum then
  326.                 local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
  327.                 if rut and not deb then
  328.                     deb = true
  329.                     hum.Health = hum.MaxHealth
  330.                     sound(workspace,160737154,2,1)
  331.                     msg(hum.Parent.Name.." found the gold block!",3)
  332.                     gen()
  333.                     rut.CFrame = startp.CFrame * cf(0,3,0)
  334.                 end
  335.             end
  336.         end)
  337.     end
  338.     local safepart = ins("Part",plat)
  339.     safepart.Anchored = true
  340.     safepart.Material = plat.Material
  341.     safepart.Color = plat.Color
  342.     safepart.Size = v3(20*platformWidth,5,20*platformWidth)
  343.     safepart.CFrame = cfpos * cf(0,-plat.Size.y/2-(safepart.Size.y/2),0)
  344.     safepart.CanCollide = false
  345.     safepart.Transparency = 1
  346.     safepart.Touched:Connect(function(hit)
  347.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  348.         if hum then
  349.             local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
  350.             if rut then
  351.                 rut.CFrame = startp.CFrame * cf(0,3,0)
  352.             end
  353.         end
  354.     end)
  355.     local ruf = ins("Part",plat)
  356.     ruf.Anchored = true
  357.     ruf.Material = plat.Material
  358.     ruf.Color = plat.Color
  359.     ruf.Size = plat.Size
  360.     ruf.CFrame = plat.CFrame * cf(0,(.75*platformWidth)+plat.Size.y,0)
  361.     local dp = ins("Part",plat)
  362.     dp.Anchored = true
  363.     dp.CanCollide = false
  364.     dp.Transparency = 1
  365.     dp.Material = plat.Material
  366.     dp.Color = plat.Color
  367.     dp.Size = v3(1,.75,1)*platformWidth
  368.     dp.CFrame = plat.CFrame * cf(0,(dp.Size.y/2)+(plat.Size.y/2),0)
  369.     dp.Name = random(-999999,999999)
  370.     dp.Touched:Connect(function(hit)
  371.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  372.         if hum then
  373.             if hum.WalkSpeed >16 then
  374.                 hum.Parent:BreakJoints()
  375.             end
  376.         end
  377.     end)
  378.     table.insert(hitboxparts,dp)
  379.     local pil = ins("Part",plat)
  380.     pil.Anchored = true
  381.     pil.Material = plat.Material
  382.     pil.Color = plat.Color
  383.     pil.Size = v3(.15,.75,.15)*platformWidth
  384.     pil.CFrame = plat.CFrame * cf(plat.Size.x/2-pil.Size.x/2,pil.Size.y/2+plat.Size.y/2,plat.Size.z/2-pil.Size.z/2)
  385.     local pw = ins("Part",plat)
  386.     pw.Anchored = true
  387.     pw.Material = plat.Material
  388.     pw.Color = plat.Color
  389.     pw.Size = v3(.15,.75,.2)*platformWidth
  390.     pw.CFrame = pil.CFrame * cf(0,0,-pw.Size.z/2-pil.Size.z/2)
  391.     local pw = ins("Part",plat)
  392.     pw.Anchored = true
  393.     pw.Material = plat.Material
  394.     pw.Color = plat.Color
  395.     pw.Size = v3(.2,.75,.15)*platformWidth
  396.     pw.CFrame = pil.CFrame * cf(-pw.Size.x/2-pil.Size.x/2,0,0)
  397.     local pil = ins("Part",plat)
  398.     pil.Anchored = true
  399.     pil.Material = plat.Material
  400.     pil.Color = plat.Color
  401.     pil.Size = v3(.15,.75,.15)*platformWidth
  402.     pil.CFrame = plat.CFrame * cf(-plat.Size.x/2+pil.Size.x/2,pil.Size.y/2+plat.Size.y/2,-plat.Size.z/2+pil.Size.z/2)
  403.     local pw = ins("Part",plat)
  404.     pw.Anchored = true
  405.     pw.Material = plat.Material
  406.     pw.Color = plat.Color
  407.     pw.Size = v3(.15,.75,.2)*platformWidth
  408.     pw.CFrame = pil.CFrame * cf(0,0,pw.Size.z/2+pil.Size.z/2)
  409.     local pw = ins("Part",plat)
  410.     pw.Anchored = true
  411.     pw.Material = plat.Material
  412.     pw.Color = plat.Color
  413.     pw.Size = v3(.2,.75,.15)*platformWidth
  414.     pw.CFrame = pil.CFrame * cf(pw.Size.x/2+pil.Size.x/2,0,0)
  415.     local pil = ins("Part",plat)
  416.     pil.Anchored = true
  417.     pil.Material = plat.Material
  418.     pil.Color = plat.Color
  419.     pil.Size = v3(.15,.75,.15)*platformWidth
  420.     pil.CFrame = plat.CFrame * cf(-plat.Size.x/2+pil.Size.x/2,pil.Size.y/2+plat.Size.y/2,plat.Size.z/2-pil.Size.z/2)
  421.     local pw = ins("Part",plat)
  422.     pw.Anchored = true
  423.     pw.Material = plat.Material
  424.     pw.Color = plat.Color
  425.     pw.Size = v3(.15,.75,.2)*platformWidth
  426.     pw.CFrame = pil.CFrame * cf(0,0,-pw.Size.z/2-pil.Size.z/2)
  427.     local pw = ins("Part",plat)
  428.     pw.Anchored = true
  429.     pw.Material = plat.Material
  430.     pw.Color = plat.Color
  431.     pw.Size = v3(.2,.75,.15)*platformWidth
  432.     pw.CFrame = pil.CFrame * cf(pw.Size.x/2+pil.Size.x/2,0,0)
  433.     local pil = ins("Part",plat)
  434.     pil.Anchored = true
  435.     pil.Material = plat.Material
  436.     pil.Color = plat.Color
  437.     pil.Size = v3(.15,.75,.15)*platformWidth
  438.     pil.CFrame = plat.CFrame * cf(plat.Size.x/2-pil.Size.x/2,pil.Size.y/2+plat.Size.y/2,-plat.Size.z/2+pil.Size.z/2)
  439.     local pw = ins("Part",plat)
  440.     pw.Anchored = true
  441.     pw.Material = plat.Material
  442.     pw.Color = plat.Color
  443.     pw.Size = v3(.15,.75,.2)*platformWidth
  444.     pw.CFrame = pil.CFrame * cf(0,0,pw.Size.z/2+pil.Size.z/2)
  445.     local pw = ins("Part",plat)
  446.     pw.Anchored = true
  447.     pw.Material = plat.Material
  448.     pw.Color = plat.Color
  449.     pw.Size = v3(.2,.75,.15)*platformWidth
  450.     pw.CFrame = pil.CFrame * cf(-pw.Size.x/2-pil.Size.x/2,0,0)
  451.     start = false
  452.     endd = false
  453.     return cfs,plat
  454. end
  455. function gen()
  456. hitboxparts = {}
  457. start = true
  458. mod:ClearAllChildren()
  459. local cfs,plat = createPlatform(cfpos)
  460. local b = ins("Part",mod)
  461. b.Anchored = true
  462. b.CanCollide = false
  463. b.Material = "Neon"
  464. b.BrickColor = bc("CGA brown")
  465. b.Size = v3(3,.5,3)
  466. b.CFrame = bcf
  467. b.Transparency = .35
  468. b.Touched:Connect(function(hit)
  469.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  470.         if hum then
  471.             local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
  472.             if rut then
  473.                 rut.CFrame = startp.CFrame * cf(0,3,0)
  474.             end
  475.         end
  476.     end)
  477. startp = plat
  478. local curcf = cfpos
  479. local oldcf = curcf
  480. local endnum
  481. local plats = {}
  482. table.insert(plats,plat)
  483. local num = random(20,26)
  484. for i = 1,num do
  485.     endnum = i
  486.     if i == num then
  487.         endd = true
  488.     end
  489.     curcf = cfs[random(1,#cfs)]
  490.     for i,v in pairs(plats) do
  491.         if (v3(curcf.x,curcf.y,curcf.z)-v.Position).Magnitude <platformWidth then
  492.             repeat
  493.             curcf = cfs[random(1,#cfs)]
  494.             until (v3(curcf.x,curcf.y,curcf.z)-v.Position).Magnitude > (platformWidth)-platformWidth/10
  495.         end
  496.     end
  497.     cfs,plat = createPlatform(curcf)
  498.     table.insert(plats,plat)
  499.     oldcf = curcf
  500. end
  501. for i,v in pairs(hitboxparts) do
  502.     local plat = v.Parent
  503.     local dp = v
  504.     local dirs = {dp.CFrame.LookVector,-dp.CFrame.LookVector,dp.CFrame.RightVector,-dp.CFrame.RightVector}
  505.     local curdir = dirs[1]
  506.     for i = 1,4 do
  507.         local hit,pos,rot = rayc(dp.Position,dirs[i],{dp},platformWidth/1.75)
  508.         curdir = dirs[i]
  509.         if not hit then
  510.             if curdir == dirs[1] then
  511.                 local pw = ins("Part",plat)
  512.                 pw.Anchored = true
  513.                 pw.Material = plat.Material
  514.                 pw.Color = plat.Color
  515.                 pw.Size = v3(.3,.75,.15)*platformWidth
  516.                 pw.CFrame = plat.CFrame * cf(0,(plat.Size.y/2)+(pw.Size.y/2),-(plat.Size.z/2)+(pw.Size.z/2))
  517.                 local randn = random(1,3)
  518.                 if randn == 1 then
  519.                     maketorch(pw.CFrame*cf(0,0,(pw.Size.z/2)+(.02*platformWidth)/2)*angles(rad(35),rad(180),0),"Front")
  520.                 end
  521.             elseif curdir == dirs[2] then
  522.                 local pw = ins("Part",plat)
  523.                 pw.Anchored = true
  524.                 pw.Material = plat.Material
  525.                 pw.Color = plat.Color
  526.                 pw.Size = v3(.3,.75,.15)*platformWidth
  527.                 pw.CFrame = plat.CFrame * cf(0,(plat.Size.y/2)+(pw.Size.y/2),(plat.Size.z/2)-(pw.Size.z/2))
  528.                 local randn = random(1,3)
  529.                 if randn == 1 then
  530.                     maketorch(pw.CFrame*cf(0,0,-(pw.Size.z/2)-(.02*platformWidth)/2)*angles(rad(-35),0,0),"Front")
  531.                 end
  532.             elseif curdir == dirs[3] then
  533.                 local pw = ins("Part",plat)
  534.                 pw.Anchored = true
  535.                 pw.Material = plat.Material
  536.                 pw.Color = plat.Color
  537.                 pw.Size = v3(.15,.75,.3)*platformWidth
  538.                 pw.CFrame = plat.CFrame * cf((plat.Size.x/2)-(pw.Size.x/2),(plat.Size.y/2)+(pw.Size.y/2),0)
  539.                 local randn = random(1,3)
  540.                 if randn == 1 then
  541.                     maketorch(pw.CFrame*cf(-(pw.Size.x/2)-(.02*platformWidth)/2,0,0)*angles(0,0,rad(35)),"Left")
  542.                 end
  543.             elseif curdir == dirs[4] then
  544.                 local pw = ins("Part",plat)
  545.                 pw.Anchored = true
  546.                 pw.Material = plat.Material
  547.                 pw.Color = plat.Color
  548.                 pw.Size = v3(.15,.75,.3)*platformWidth
  549.                 pw.CFrame = plat.CFrame * cf(-(plat.Size.x/2)+(pw.Size.x/2),(plat.Size.y/2)+(pw.Size.y/2),0)
  550.                 local randn = random(1,3)
  551.                 if randn == 1 then
  552.                     maketorch(pw.CFrame*cf((pw.Size.x/2)+(.02*platformWidth)/2,0,0)*angles(0,0,rad(-35)),"Right")
  553.                 end
  554.             end
  555.         end
  556.     end
  557.     for i,v in pairs(mod:GetDescendants()) do
  558.         if v:IsA("Part") then
  559.             v.Locked = true
  560.         end
  561.     end
  562. end
  563. print("total amount: "..endnum)
  564. end
  565. gen()
  566. local rem = ins("RemoteEvent",owner.PlayerGui)
  567. rem.Name = "ddd"
  568. rem.OnServerEvent:Connect(function(plr)
  569. maketorch(owner.Character.Torso.CFrame)
  570. gen()
  571. end)
  572. owner.Chatted:Connect(function(msg)
  573. if msg:lower() == "tp" then
  574. owner.Character.HumanoidRootPart.CFrame = startp.CFrame * cf(0,3,0)
  575. end
  576. end)
  577. local client = NLS([[
  578. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  579. local rem = owner.PlayerGui:WaitForChild("ddd")
  580. mouse.KeyDown:Connect(function(key)
  581. if key == "r" then
  582. rem:FireServer()
  583. end
  584. end)
  585. ]],owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement