Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by GearsOfPower
- -- http://pastebin.com/raw/FhkuCZDD
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- repeat wait() until Player.Character
- local Character = Player.Character
- local scriptId = "GhostScriptID-9211"
- script.Name = scriptId
- script.Parent = Player.PlayerScripts
- local GhostObject
- local SwordObject
- -- | Functions
- -- General
- local General = {}
- function General.LoopClosure(parent, func)
- for _,v in pairs(parent:GetChildren()) do
- func(v)
- end
- end
- function General.IsMainBodyPart(part)
- if part:IsA("Part") and part.Name ~= "HumanoidRootPart" and part.Name ~= "Head" then
- return true
- else
- return false
- end
- end
- function General.TweenTransparency(model, start, finish)
- local value = start
- if start < finish then
- repeat
- value = value + 0.1
- General.LoopClosure(model, function(v)
- if General.IsMainBodyPart(v) then
- v.Transparency = value
- end
- end)
- wait()
- until value >= finish
- else
- repeat
- value = value - 0.1
- General.LoopClosure(model, function(v)
- if General.IsMainBodyPart(v) then
- v.Transparency = value
- end
- end)
- wait()
- until value <= finish
- end
- end
- function General.TweenSize(part, start, finish, increment, waitTime)
- local value = start
- if start < finish then
- repeat
- value = value + increment
- part.Size = part.Size + Vector3.new(increment, increment, increment)
- wait(waitTime)
- until value >= finish
- else
- repeat
- value = value - increment
- part.Size = part.Size - Vector3.new(increment, increment, increment)
- wait(waitTime)
- until value <= finish
- end
- end
- function General.TweenSizeCo(part, start, finish, increment, waitTime, tweenFunction, finishedFunction)
- coroutine.resume(coroutine.create(function()
- local value = start
- if start < finish then
- repeat
- if part == nil then break end
- value = value + increment
- part.Size = part.Size + Vector3.new(increment, increment, increment)
- if tweenFunction ~= nil then tweenFunction() end
- wait(waitTime)
- until value >= finish
- else
- repeat
- if part == nil then break end
- value = value - increment
- part.Size = part.Size - Vector3.new(increment, increment, increment)
- if tweenFunction ~= nil then tweenFunction() end
- wait(waitTime)
- until value <= finish
- end
- if finishedFunction ~= nil then
- finishedFunction()
- end
- end))
- end
- function General.IsCharacter(part)
- if part == nil then return end
- if part:FindFirstChild("Humanoid") or part.Parent:FindFirstChild("Humanoid") or part.Parent.Parent:FindFirstChild("Humanoid") then
- return true
- else
- return false
- end
- end
- function General.GetCharacter(part)
- if part == nil then return end
- if part.Parent:FindFirstChild("Humanoid") then
- return part.Parent
- elseif part.Parent.Parent:FindFirstChild("Humanoid") then
- return part.Parent.Parent
- end
- end
- function General.GetPlayer(part)
- local character = General.GetCharacter(part)
- if character ~= nil then
- local player = game.Players:GetPlayerFromCharacter(character)
- if player ~= nil then
- return player
- end
- end
- end
- function General.Weld(part1, part2)
- local weld = Instance.new("Weld", part1)
- weld.Part0 = part1
- weld.Part1 = part2
- return weld
- end
- -- Animations
- -- RIGHT ARM ANGLES | C0 ( +FORWARD/-BACK, +TILT LEFT/-TILT RIGHT, +OUT/-IN ) | C1 INVERSE
- local Animation = {}
- Animation.rigged = false
- function Animation.RigCharacter(character)
- local rightArmWeld
- if not character.Torso:FindFirstChild("RightArmWeld") then
- rightArmWeld = General.Weld(character.Torso, character["Right Arm"])
- rightArmWeld.Name = "RightArmWeld"
- rightArmWeld.C1 = rightArmWeld.C1 * CFrame.new(-1.5, 0, 0)
- else
- rightArmWeld = character.Torso.RightArmWeld
- end
- Animation.Root = character.HumanoidRootPart:WaitForChild("RootJoint")
- Animation.RootRoot = {Animation.Root.C0, Animation.Root.C1} -- the name......
- Animation.RightArm = rightArmWeld
- Animation.RightArmRoot = {rightArmWeld.C0, rightArmWeld.C1}
- Animation.rigged = true
- end
- function Animation.Reset()
- if not Animation.rigged then return end
- Animation.Root.C0 = Animation.RootRoot[1]
- Animation.Root.C1 = Animation.RootRoot[2]
- Animation.RightArm.C0 = Animation.RightArmRoot[1]
- Animation.RightArm.C1 = Animation.RightArmRoot[2]
- end
- function Animation.Destroy()
- Animation.RightArm:Destroy()
- Animation.rigged = false
- end
- Player.Character:BreakJoints()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement