Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local module = {}
- local TweenService = game:GetService("TweenService")
- local Execute = workspace:WaitForChild("Execute")
- module.Clone = function(seconds, animTime)
- local Assets = script.Parent:WaitForChild("Assets")
- local healingCircle = Assets:WaitForChild("healingCircle")
- local coolDown = false
- Execute.OnServerEvent:Connect(function(plr)
- local healingCircleClone = healingCircle:Clone()
- healingCircleClone:WaitForChild("heal").Disabled = false
- repeat wait() until plr.Character
- local Character = plr.Character
- local HRP = Character:WaitForChild("HumanoidRootPart")
- local Humanoid = Character:WaitForChild("Humanoid")
- if not coolDown then
- coolDown = true
- local Map = workspace:FindFirstChild(game.ReplicatedStorage.ActiveMap.Value)
- if Map ~= nil then
- local Folder = Map:FindFirstChild("Blocks")
- if Folder ~= nil then
- healingCircleClone.Parent = Folder
- end
- end
- local tweenInfo = TweenInfo.new(animTime)
- local goal_One = {}
- goal_One.Size = Vector3.new(140, 9, 9)
- local tween_One = TweenService:Create(healingCircleClone, tweenInfo, goal_One)
- tween_One:Play()
- local Weld = Instance.new("Weld")
- if HRP then
- healingCircleClone.Anchored = false
- Weld.Part0 = HRP
- Weld.Part1 = healingCircleClone
- healingCircleClone.CFrame = HRP.CFrame - Vector3.new(0, 10, 0)
- healingCircleClone.CFrame = healingCircleClone.CFrame * CFrame.Angles(0, 0, math.rad(90))
- Weld.C0 = HRP.CFrame:inverse()
- Weld.C1 = healingCircleClone.CFrame:inverse()
- Weld.Parent = healingCircleClone
- end
- if Humanoid then
- Humanoid.Died:Connect(function()
- local goal_Three = {}
- goal_Three.Transparency = 1
- local tween_Three = TweenService:Create(healingCircleClone, tweenInfo, goal_Three)
- tween_Three:Play()
- wait(animTime)
- healingCircleClone:Destroy()
- end)
- end
- wait(seconds)
- local goal_Two = {}
- goal_Two.Size = Vector3.new(0, 9, 9)
- local tween_Two = TweenService:Create(healingCircleClone, tweenInfo, goal_Two)
- tween_Two:Play()
- wait(animTime)
- healingCircleClone:Destroy()
- coolDown = false
- end
- end)
- end
- return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement