Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent=workspace
- local tweens = game:GetService("TweenService")
- local debrs = game:GetService("Debris")
- local ins = Instance.new
- local v3 = Vector3.new
- local cf = CFrame.new
- local angles = CFrame.Angles
- local rad = math.rad
- local huge = math.huge
- local cos = math.cos
- local sin = math.sin
- local tan = math.tan
- local ray = Ray.new
- local random = math.random
- local ud = UDim.new
- local ud2 = UDim2.new
- local c3 = Color3.new
- local rgb = Color3.fromRGB
- local bc = BrickColor.new
- local platformWidth = 50
- local platfromHeight = 5
- local cfpos = cf(0,200,1500)*cf(0,platfromHeight/2,0)
- local bcf = cf(30,0,-30)
- local material = "Cobblestone"
- local colors = {"Dark green","Black","Tr. Green","Earth green","Parsley green","Shamrock"}
- local start = true
- local endd = false
- local curcolor
- local startp
- local hitboxparts = {}
- local directions = {In = Enum.EasingDirection.In,
- Out = Enum.EasingDirection.Out,
- InOut = Enum.EasingDirection.InOut
- }
- local styles = {Linear = Enum.EasingStyle.Linear,
- Back = Enum.EasingStyle.Back,
- Bounce = Enum.EasingStyle.Bounce,
- Sine = Enum.EasingStyle.Sine,
- Quad = Enum.EasingStyle.Quad,
- Elastic = Enum.EasingStyle.Elastic,
- Quart = Enum.EasingStyle.Quart,
- Quint = Enum.EasingStyle.Quint
- }
- local mod = ins("Model",script)
- local tlerp = function(part,tablee,leinght,easingstyle,easingdirec)
- local info = TweenInfo.new(
- leinght,
- easingstyle,
- easingdirec,
- 0,
- false,
- 0
- )
- local lerp = tweens:Create(part,info,tablee)
- lerp:Play()
- end
- function sound(parent,id,vol,pitch)
- pcall(function()
- local sound = Instance.new("Sound",parent)
- sound.Volume = vol
- sound.SoundId = "rbxassetid://"..id
- sound.Pitch = pitch
- sound:Play()
- coroutine.resume(coroutine.create(function()
- repeat
- wait()
- until sound.Playing == false
- sound:Destroy()
- end))
- end)
- end
- function lesserfirepart(parttofire)
- coroutine.resume(coroutine.create(function()
- for i = 1,random(6,12) do
- if not parttofire or not parttofire.Parent then
- break
- end
- 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))
- wait(.25)
- end
- end))
- end
- function damagingfire(partp,parent,color1,color2,ssize,osize,leinght,material,minr,maxr,shape,spread,st,ot,onlyraise,damage)
- local deb = false
- local part = Instance.new("Part",parent) part.Size = Vector3.new(ssize,ssize,ssize) part.Transparency = st part.CanCollide = false part.Anchored = true part.Name="Fire" 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))
- if onlyraise == true then
- part.CFrame = CFrame.new(part.CFrame.p,Vector3.new(part.Position.y,part.CFrame.y,part.CFrame.z))
- end
- part.Touched:Connect(function(hit)
- if not deb then
- local newhum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if newhum and newhum ~= hum then
- deb = false
- local rand = random(1,6)
- if rand == 3 then
- lesserfirepart(hit)
- end
- newhum.Health = newhum.Health -damage
- end
- end
- end)
- local pcf = part.CFrame
- 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)
- game:GetService("Debris"):AddItem(part,leinght)
- end
- function msg(text,time)
- local msg = ins("Hint",workspace)
- msg.Text = text
- game:GetService("Debris"):AddItem(msg,time)
- end
- function maketorch(pos,face)
- local p = ins("Part",mod)
- p.Material = "Wood"
- p.BrickColor = bc("Brown")
- p.Anchored = true
- p.Size = v3(.02,.06,.02)*platformWidth
- p.CFrame = pos
- local oldp = p
- local p = ins("Part",mod)
- p.Material = "Neon"
- p.BrickColor = bc("CGA brown")
- p.Anchored = true
- p.Size = v3(.0225,.0225,.0225)*platformWidth
- p.CFrame = oldp.CFrame*cf(0,oldp.Size.y/2+p.Size.y/2,0)
- local light = ins("SurfaceLight",p)
- light.Face = face
- light.Color = p.Color
- light.Angle = 180
- light.Range = 35
- light.Brightness = 2.5
- end
- function tooltorch(who)
- local tool = ins("Tool")
- tool.Name = "Torch"
- local p = ins("Part",tool)
- p.Material = "Wood"
- p.BrickColor = bc("Brown")
- p.Anchored = false
- p.CanCollide = false
- p.Size = v3(.35,1.5,.35)
- p.Name = "Handle"
- p.CFrame = cf(0,1000,0)
- local oldp = p
- local p = ins("Part",oldp)
- p.Material = "Neon"
- p.BrickColor = bc("CGA brown")
- p.Anchored = false
- p.CanCollide = false
- p.Size = v3(.425,.425,.425)
- p.CFrame = oldp.CFrame*cf(0,oldp.Size.y/2+p.Size.y/2,0)
- local weld = ins("WeldConstraint",oldp)
- weld.Part0 = oldp
- weld.Part1 = p
- local light = ins("SurfaceLight",p)
- light.Face = "Front"
- light.Color = p.Color
- light.Angle = 180
- light.Range = 20
- light.Brightness = 4
- local light = ins("SurfaceLight",p)
- light.Face = "Back"
- light.Color = p.Color
- light.Angle = 180
- light.Range = 20
- light.Brightness = 4
- tool.Parent = who
- end
- function maketrap(pos)
- local p = ins("Part",mod)
- p.Material = "Slate"
- p.BrickColor = bc("Darkgrey")
- p.Anchored = true
- p.Size = v3(.15,.25,.15)*platformWidth
- p.CFrame = pos
- p.CanCollide = false
- local msh = ins("BlockMesh",p)
- msh.Scale = v3(.25,.01,.25)
- local deb = false
- p.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum and not deb then
- deb = true
- sound(p,158853971,10,15)
- for i = 1,random(5,8) do
- 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))
- wait()
- end
- wait(3.5)
- deb = false
- end
- end)
- end
- function rayc(spos,direc,ignore,dist)
- local rai = ray(spos,direc.Unit * dist)
- local rhit,rpos,rrot = workspace:FindPartOnRayWithIgnoreList(rai,ignore,false,false)
- return rhit,rpos,rrot
- end
- function createPlatform(cfr)
- local plat = ins("Part",mod)
- plat.Anchored = true
- plat.Size = v3(platformWidth,platfromHeight,platformWidth)
- plat.CFrame = cfr
- plat.Material = material
- curcolor = bc(colors[random(1,#colors)])
- local rannum = random(1,2)
- if rannum == 2 and not start then
- local xa = random(-10,10)
- local za = random(-10,10)
- if xa == 1 then
- xa = 2
- elseif xa == -1 then
- xa = -2
- end
- if za == 1 then
- za = 2
- elseif za == -1 then
- za = -2
- end
- maketrap(plat.CFrame*cf(xa,plat.Size.y/2,za),tostring(plat.BrickColor))
- end
- if start then
- plat.BrickColor = bc("Camo")
- local light = ins("SurfaceLight",plat)
- light.Face = "Top"
- light.Color = plat.Color
- light.Angle = 180
- light.Range = plat.Size.z
- light.Brightness = 2
- local backb = ins("Part",plat)
- backb.Anchored = true
- backb.CanCollide = false
- backb.Material = "Neon"
- backb.BrickColor = bc("CGA brown")
- backb.Size = v3(.1,.15,.1)*platformWidth
- backb.CFrame = plat.CFrame * cf(plat.Size.x/3,plat.Size.y/2+backb.Size.y/2,plat.Size.z/3)
- backb.Transparency = .5
- local p = ins("Part",plat)
- p.Material = "Neon"
- p.BrickColor = bc("CGA brown")
- p.Anchored = true
- p.Size = v3(.025,.025,.025)*platformWidth
- p.CFrame = plat.CFrame * cf(-plat.Size.x/7.5,(plat.Size.y/2)+p.Size.y/2,-plat.Size.z/7.5)
- p.CanCollide = false
- p.Transparency = .5
- local billb = ins("BillboardGui",mod)
- billb.Adornee = p
- billb.StudsOffset = Vector3.new(0,backb.Size.y/1.5,0)
- billb.Size = UDim2.new(4.5,0,1.5,0)
- billb.AlwaysOnTop = true
- billb.MaxDistance = 20
- local l = Instance.new("TextBox",billb)
- l.Size = UDim2.new(1,0,1,0)
- l.BorderSizePixel = 0
- l.BackgroundTransparency = 1
- l.TextScaled = true
- l.Text = "Click to get the torch"
- l.TextColor = bc("CGA brown")
- l.Rotation = 0
- l.TextStrokeTransparency = 0
- l.TextStrokeColor3 = bc("CGA brown").Color
- local cld = ins("ClickDetector",p)
- cld.MouseClick:Connect(function(plr)
- tooltorch(plr.Backpack)
- end)
- local billb = ins("BillboardGui",mod)
- billb.Adornee = backb
- billb.StudsOffset = Vector3.new(0,backb.Size.y/1.5,0)
- billb.Size = UDim2.new(4.5,0,1.5,0)
- billb.AlwaysOnTop = true
- billb.MaxDistance = 20
- local l = Instance.new("TextBox",billb)
- l.Size = UDim2.new(1,0,1,0)
- l.BorderSizePixel = 0
- l.BackgroundTransparency = 1
- l.TextScaled = true
- l.Text = "Touch this part to get back to the baseplate"
- l.TextColor = bc("CGA brown")
- l.Rotation = 0
- l.TextStrokeTransparency = 0
- l.TextStrokeColor3 = bc("CGA brown").Color
- backb.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
- if rut then
- rut.CFrame = cf(0,3,0)
- end
- end
- end)
- elseif endd then
- plat.BrickColor = curcolor
- elseif not start and not endd then
- plat.BrickColor = curcolor
- end
- local cfs = {
- plat.CFrame *cf(plat.Size.x+0/5,0,0),
- plat.CFrame *cf(-plat.Size.x-0/5,0,0),
- plat.CFrame *cf(0,0,plat.Size.z+0/5),
- plat.CFrame *cf(0,0,-plat.Size.z-0/5)
- }
- if endd then
- local rew = ins("Part",plat)
- rew.Anchored = true
- rew.Material = "Glass"
- rew.BrickColor = bc("Gold")
- rew.Size = v3(.05,.05,.05)*platformWidth
- rew.CFrame = plat.CFrame * cf(0,(rew.Size.y/2)+plat.Size.y/2,0)
- rew.Name = random(-999999,999999)
- print(rew.Name)
- local light = ins("SurfaceLight",rew)
- light.Face = "Top"
- light.Color = rew.Color
- light.Angle = 180
- light.Range = 30
- light.Brightness = 3
- local deb = false
- rew.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
- if rut and not deb then
- deb = true
- hum.Health = hum.MaxHealth
- sound(workspace,160737154,2,1)
- msg(hum.Parent.Name.." found the gold block!",3)
- gen()
- rut.CFrame = startp.CFrame * cf(0,3,0)
- end
- end
- end)
- end
- local safepart = ins("Part",plat)
- safepart.Anchored = true
- safepart.Material = plat.Material
- safepart.Color = plat.Color
- safepart.Size = v3(20*platformWidth,5,20*platformWidth)
- safepart.CFrame = cfpos * cf(0,-plat.Size.y/2-(safepart.Size.y/2),0)
- safepart.CanCollide = false
- safepart.Transparency = 1
- safepart.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
- if rut then
- rut.CFrame = startp.CFrame * cf(0,3,0)
- end
- end
- end)
- local ruf = ins("Part",plat)
- ruf.Anchored = true
- ruf.Material = plat.Material
- ruf.Color = plat.Color
- ruf.Size = plat.Size
- ruf.CFrame = plat.CFrame * cf(0,(.75*platformWidth)+plat.Size.y,0)
- local dp = ins("Part",plat)
- dp.Anchored = true
- dp.CanCollide = false
- dp.Transparency = 1
- dp.Material = plat.Material
- dp.Color = plat.Color
- dp.Size = v3(1,.75,1)*platformWidth
- dp.CFrame = plat.CFrame * cf(0,(dp.Size.y/2)+(plat.Size.y/2),0)
- dp.Name = random(-999999,999999)
- dp.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- if hum.WalkSpeed >16 then
- hum.Parent:BreakJoints()
- end
- end
- end)
- table.insert(hitboxparts,dp)
- local pil = ins("Part",plat)
- pil.Anchored = true
- pil.Material = plat.Material
- pil.Color = plat.Color
- pil.Size = v3(.15,.75,.15)*platformWidth
- 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)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.2)*platformWidth
- pw.CFrame = pil.CFrame * cf(0,0,-pw.Size.z/2-pil.Size.z/2)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.2,.75,.15)*platformWidth
- pw.CFrame = pil.CFrame * cf(-pw.Size.x/2-pil.Size.x/2,0,0)
- local pil = ins("Part",plat)
- pil.Anchored = true
- pil.Material = plat.Material
- pil.Color = plat.Color
- pil.Size = v3(.15,.75,.15)*platformWidth
- 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)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.2)*platformWidth
- pw.CFrame = pil.CFrame * cf(0,0,pw.Size.z/2+pil.Size.z/2)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.2,.75,.15)*platformWidth
- pw.CFrame = pil.CFrame * cf(pw.Size.x/2+pil.Size.x/2,0,0)
- local pil = ins("Part",plat)
- pil.Anchored = true
- pil.Material = plat.Material
- pil.Color = plat.Color
- pil.Size = v3(.15,.75,.15)*platformWidth
- 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)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.2)*platformWidth
- pw.CFrame = pil.CFrame * cf(0,0,-pw.Size.z/2-pil.Size.z/2)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.2,.75,.15)*platformWidth
- pw.CFrame = pil.CFrame * cf(pw.Size.x/2+pil.Size.x/2,0,0)
- local pil = ins("Part",plat)
- pil.Anchored = true
- pil.Material = plat.Material
- pil.Color = plat.Color
- pil.Size = v3(.15,.75,.15)*platformWidth
- 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)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.2)*platformWidth
- pw.CFrame = pil.CFrame * cf(0,0,pw.Size.z/2+pil.Size.z/2)
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.2,.75,.15)*platformWidth
- pw.CFrame = pil.CFrame * cf(-pw.Size.x/2-pil.Size.x/2,0,0)
- start = false
- endd = false
- return cfs,plat
- end
- function gen()
- hitboxparts = {}
- start = true
- mod:ClearAllChildren()
- local cfs,plat = createPlatform(cfpos)
- local b = ins("Part",mod)
- b.Anchored = true
- b.CanCollide = false
- b.Material = "Neon"
- b.BrickColor = bc("CGA brown")
- b.Size = v3(3,.5,3)
- b.CFrame = bcf
- b.Transparency = .35
- b.Touched:Connect(function(hit)
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum then
- local rut = hum.Parent:FindFirstChild("HumanoidRootPart")
- if rut then
- rut.CFrame = startp.CFrame * cf(0,3,0)
- end
- end
- end)
- startp = plat
- local curcf = cfpos
- local oldcf = curcf
- local endnum
- local plats = {}
- table.insert(plats,plat)
- local num = random(30,45)
- for i = 1,num do
- endnum = i
- if i == num then
- endd = true
- end
- curcf = cfs[random(1,#cfs)]
- for i,v in pairs(plats) do
- if (v3(curcf.x,curcf.y,curcf.z)-v.Position).Magnitude <platformWidth then
- repeat
- curcf = cfs[random(1,#cfs)]
- until (v3(curcf.x,curcf.y,curcf.z)-v.Position).Magnitude > (platformWidth)-platformWidth/10
- end
- end
- cfs,plat = createPlatform(curcf)
- table.insert(plats,plat)
- oldcf = curcf
- end
- for i,v in pairs(hitboxparts) do
- local plat = v.Parent
- local dp = v
- local dirs = {dp.CFrame.LookVector,-dp.CFrame.LookVector,dp.CFrame.RightVector,-dp.CFrame.RightVector}
- local curdir = dirs[1]
- for i = 1,4 do
- local hit,pos,rot = rayc(dp.Position,dirs[i],{dp},platformWidth/1.75)
- curdir = dirs[i]
- if not hit then
- if curdir == dirs[1] then
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.3,.75,.15)*platformWidth
- pw.CFrame = plat.CFrame * cf(0,(plat.Size.y/2)+(pw.Size.y/2),-(plat.Size.z/2)+(pw.Size.z/2))
- local randn = random(1,3)
- if randn == 1 then
- maketorch(pw.CFrame*cf(0,0,(pw.Size.z/2)+(.02*platformWidth)/2)*angles(rad(35),rad(180),0),"Front")
- end
- elseif curdir == dirs[2] then
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.3,.75,.15)*platformWidth
- pw.CFrame = plat.CFrame * cf(0,(plat.Size.y/2)+(pw.Size.y/2),(plat.Size.z/2)-(pw.Size.z/2))
- local randn = random(1,3)
- if randn == 1 then
- maketorch(pw.CFrame*cf(0,0,-(pw.Size.z/2)-(.02*platformWidth)/2)*angles(rad(-35),0,0),"Front")
- end
- elseif curdir == dirs[3] then
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.3)*platformWidth
- pw.CFrame = plat.CFrame * cf((plat.Size.x/2)-(pw.Size.x/2),(plat.Size.y/2)+(pw.Size.y/2),0)
- local randn = random(1,3)
- if randn == 1 then
- maketorch(pw.CFrame*cf(-(pw.Size.x/2)-(.02*platformWidth)/2,0,0)*angles(0,0,rad(35)),"Left")
- end
- elseif curdir == dirs[4] then
- local pw = ins("Part",plat)
- pw.Anchored = true
- pw.Material = plat.Material
- pw.Color = plat.Color
- pw.Size = v3(.15,.75,.3)*platformWidth
- pw.CFrame = plat.CFrame * cf(-(plat.Size.x/2)+(pw.Size.x/2),(plat.Size.y/2)+(pw.Size.y/2),0)
- local randn = random(1,3)
- if randn == 1 then
- maketorch(pw.CFrame*cf((pw.Size.x/2)+(.02*platformWidth)/2,0,0)*angles(0,0,rad(-35)),"Right")
- end
- end
- end
- end
- for i,v in pairs(mod:GetDescendants()) do
- if v:IsA("Part") then
- v.Locked = true
- end
- end
- end
- print("total amount: "..endnum)
- end
- gen()
- local rem = ins("RemoteEvent",owner.PlayerGui)
- rem.Name = "ddd"
- rem.OnServerEvent:Connect(function(plr)
- maketorch(owner.Character.Torso.CFrame)
- gen()
- end)
- owner.Chatted:Connect(function(msg)
- if msg:lower() == "tp" then
- owner.Character.HumanoidRootPart.CFrame = startp.CFrame * cf(0,3,0)
- end
- end)
- local client = NLS([[
- local mouse = game:GetService("Players").LocalPlayer:GetMouse()
- local rem = owner.PlayerGui:WaitForChild("ddd")
- mouse.KeyDown:Connect(function(key)
- if key == "r" then
- rem:FireServer()
- end
- end)
- ]],owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement