Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ts = game:GetService("TweenService") -- gets tweenservice, a handy dandy tool for animating things
- script.Parent.OnServerEvent:Connect(function(plr)-- if the remote event has been fired
- local char = plr.Character -- gets the character
- local root = char.HumanoidRootPart -- gets the root part
- local mountain = game.ReplicatedStorage.mainice:Clone()
- mountain.Parent = char
- for i,v in pairs(mountain:GetChildren()) do --loops inside the mountain part
- v.Transparency = 1 --makes the parts inside the mountain hitbox part transparent
- end
- mountain.CFrame = root.CFrame + root.CFrame.lookVector * 28 --makes the ice mountains original position
- mountain.Position = mountain.Position + Vector3.new(0,.1,0)
- for i,v in pairs(mountain:GetChildren()) do --loops inside the mountain part
- ts:Create(v,TweenInfo.new(.2,0,0),{Transparency = 0}):Play() --animates the parts inside the mountain so they are not transparent
- end
- ts:Create(mountain,TweenInfo.new(.2,0,0),{CFrame = mountain.CFrame + mountain.CFrame.lookVector * .5,Position = mountain.Position - Vector3.new(0,.15,0)}):Play() --animates the mountain so it moves forwards
- game.Debris:AddItem(mountain,6) --makes the mountain nonexistent in six seconds
- --DAMAGE DEALER
- for i,v in pairs(workspace:GetChildren()) do -- look through all the workspace
- if v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") and v.Name ~= plr.Name then --if the thing we are looking in has a humanoid and a head and its name isnt the players name then
- local dist = (v.Head.Position - mountain.Position).magnitude --find the distance between us and the ting
- if dist < 25 then -- if its less than 35 studs then
- v.Humanoid:TakeDamage(30) -- take 30 damage
- local bv = Instance.new("BodyVelocity",v.HumanoidRootPart) --make the knockback
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge) -- maximum force
- bv.Velocity = root.CFrame.lookVector * 45 + Vector3.new(0,35,0) -- the force
- game.Debris:AddItem(bv,.5) --it will last 0.5 seconds
- end
- end
- end
- --back to effects
- wait(5) --waits 5 seconds
- for i,v in pairs(mountain:GetChildren()) do --loops inside the mountain part
- ts:Create(v,TweenInfo.new(.4,0,0),{Transparency = 1}):Play() --animates the parts inside the mountain so they are transparency
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment