Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Part2 = Instance.new("Part")
- Part3 = Instance.new("Part")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Model0.Parent = script
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(0.349994659, 20.5, 35, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(0.34999465942383, 20.5, 35)
- Part1.Size = Vector3.new(88.900001525879, 41, 2)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part2.Parent = Model0
- Part2.CFrame = CFrame.new(-3.45000005, 20.5, -40.1999969, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part2.Orientation = Vector3.new(0, 180, 0)
- Part2.Position = Vector3.new(-3.4500000476837, 20.5, -40.199996948242)
- Part2.Rotation = Vector3.new(-180, 0, -180)
- Part2.Size = Vector3.new(88.900001525879, 41, 2)
- Part2.Anchored = true
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part3.Parent = Model0
- Part3.CFrame = CFrame.new(-38.5999908, 20.5, -8.05000591, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Part3.Orientation = Vector3.new(0, -90, 0)
- Part3.Position = Vector3.new(-38.599990844727, 20.5, -8.0500059127808)
- Part3.Rotation = Vector3.new(0, -90, 0)
- Part3.Size = Vector3.new(88.900001525879, 41, 2)
- Part3.Anchored = true
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part4.Parent = Model0
- Part4.CFrame = CFrame.new(-4.35000801, 39.6999969, -5.3499999, 0, -1, 0, 0, 0, -1, 1, 0, 0)
- Part4.Orientation = Vector3.new(90, -90, 0)
- Part4.Position = Vector3.new(-4.3500080108643, 39.699996948242, -5.3499999046326)
- Part4.Rotation = Vector3.new(90, 0, 90)
- Part4.Size = Vector3.new(99.099998474121, 88.699996948242, 2)
- Part4.Anchored = true
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part5.Parent = Model0
- Part5.CFrame = CFrame.new(40.3000031, 20.5, -4.05000639, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part5.Orientation = Vector3.new(0, 90, 0)
- Part5.Position = Vector3.new(40.300003051758, 20.5, -4.0500063896179)
- Part5.Rotation = Vector3.new(0, 90, 0)
- Part5.Size = Vector3.new(88.900001525879, 41, 2)
- Part5.Anchored = true
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.TopSurface = Enum.SurfaceType.Smooth
- local offset = Vector3.new(0,0,-50)
- local maxsize = 5
- for i,v in pairs(script.Model:GetChildren()) do
- if v:IsA("Part") then
- v.Transparency = 0.5
- v.CanCollide = false
- v.Position = v.Position+offset
- end
- end
- local sfx = {
- crack = {
- 151284431,
- 259586543,
- },
- hit = {
- 3092866899,
- }
- }
- local pf = Instance.new("Folder",script)
- function raycast(Pos, Dir, Max, Ignore)
- local rayparams = RaycastParams.new()
- rayparams.FilterType = Enum.RaycastFilterType.Blacklist
- rayparams.FilterDescendantsInstances = Ignore
- rayparams.IgnoreWater = true
- return workspace:Raycast(Pos, Dir * (Max or 999.999), rayparams)
- end
- local speed = 50
- function reflect(pos,n,attempts,ignore)
- ignore = ignore or {pf}
- attempts = attempts or 0
- if attempts >= 5 then return end
- local m1,m2,m3 = math.random(),math.random(),math.random()
- if math.random(1,2) == 1 then
- m1 = -m1
- end
- if math.random(1,2) == 1 then
- m2 = -m2
- end
- if math.random(1,2) == 1 then
- m3 = -m3
- end
- n = n or Vector3.new(m1,m2,m3)
- local result = raycast(pos,n,nil,ignore)
- if result and 1 > result.Instance.Transparency --[[and result.Instance.CanCollide]] then
- local char = result.Instance.Parent
- local root = char:FindFirstChild("HumanoidRootPart")
- local hum = char:FindFirstChildOfClass("Humanoid")
- if root and hum then
- hum:TakeDamage(30)
- local hitfx = Instance.new("Sound")
- hitfx.SoundId = 'rbxassetid://' .. sfx.hit[math.random(1,#sfx.hit)]
- hitfx.Volume = 0.5
- hitfx.Parent = root
- hitfx:Play()
- game:GetService("Debris"):AddItem(hitfx,1)
- end
- else
- attempts = attempts + 1
- if result then
- ignore = {result.Instance,unpack(ignore)}
- end
- reflect(pos,n,attempts,ignore)
- return
- end
- local newn = n-(2*n:Dot(result.Normal)*result.Normal)
- n = newn
- local dist = (pos-result.Position).Magnitude
- local rs = dist/speed
- local npart = Instance.new("Part")
- npart.Size = Vector3.new()
- npart.CanCollide = false
- npart.Anchored = true
- npart.Position = result.Position
- npart.Transparency = 1
- npart.Parent = pf
- local ricofx = Instance.new("Sound")
- ricofx.SoundId = 'rbxassetid://' .. sfx.crack[math.random(1,#sfx.crack)]
- ricofx.Volume = 1
- ricofx.Parent = npart
- ricofx:Play()
- local reflection = Instance.new("Part")
- reflection.CFrame = CFrame.new(pos,result.Position)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0,0,0)
- reflection.Size = Vector3.new(0.1,0,0.1)
- reflection.Color = Color3.new(1,0,0)
- reflection.Material = Enum.Material.Neon
- reflection.Anchored = true
- reflection.CanCollide = false
- reflection.Transparency = 0
- reflection.Parent = pf
- game:GetService("TweenService"):Create(reflection,TweenInfo.new(rs/2),{
- CFrame = CFrame.new(pos,result.Position)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0,-(dist-maxsize/2),0),
- Size = Vector3.new(0.1,maxsize,0.1),
- }):Play()
- game:GetService("TweenService"):Create(reflection,TweenInfo.new(rs),{
- Transparency = 1,
- Color = Color3.new(),
- }):Play()
- wait(rs/2)
- game:GetService("TweenService"):Create(reflection,TweenInfo.new(rs/2),{
- CFrame = CFrame.new(pos,result.Position)*CFrame.Angles(math.rad(90),0,0)*CFrame.new(0,-dist,0),
- Size = Vector3.new(0.1,0,0.1),
- }):Play()
- game:GetService("Debris"):AddItem(reflection,rs)
- game:GetService("Debris"):AddItem(npart,rs)
- reflect(result.Position,n)
- end
- for i = 1,10 do
- coroutine.wrap(function()
- reflect(Vector3.new(0,5,0)+offset)
- end)()
- end
Add Comment
Please, Sign In to add comment