Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RS = game:GetService("ReplicatedStorage")
- local Stand = RS:WaitForChild("Stand")
- Stand.OnServerEvent:Connect(function(player,active)
- if active == false then
- local Character = player.Character
- local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
- local Folder = Instance.new("Folder",workspace)
- Folder.Name = player.Name.." Stand"
- local Stands = script:WaitForChild("Dummy"):Clone()
- local childs = Stands:GetDescendants()
- for i,v in pairs(childs) do
- if v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart" or v:IsA("UnionOperation") then
- v.Transparency = 1
- local currentMaterial = v.Material
- v.Material = Enum.Material.Plastic
- delay(0,function()
- for i =1,10 do
- v.Transparency = v.Transparency -0.1
- wait()
- end
- v.Material = currentMaterial
- end)
- end
- end
- Stands.Parent = Folder
- Stands:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,0,0)
- local S = Stands.HumanoidRootPart.Summon
- S:play()
- local weld = Instance.new("ManualWeld")
- weld.Name = "Stand Weld"
- weld.Part0 = Stands:WaitForChild("HumanoidRootPart")
- weld.Part1 = HumanoidRP
- weld.C0 = Stands:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
- weld.Parent = weld.Part0
- local animcontrol = Stands:WaitForChild("AnimControl")
- local idle = animcontrol:LoadAnimation(script:WaitForChild("Idle"))
- idle:Play()
- end
- end)
- Stand.OnServerEvent:Connect(function(player,active)
- if active == true then
- local Character = player.Character
- local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
- local stand = workspace:WaitForChild(player.Name.." Stand")
- local Chils = stand:FindFirstChild("Dummy")
- local childs = Chils:GetChildren()
- for i,v in pairs(childs) do
- if v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart" or v:IsA("UnionOperation") then
- local currentMaterial = v.Material
- v.Material = Enum.Material.ForceField
- delay(0.2,function()
- for i =1,10 do
- v.Transparency = v.Transparency +0.1
- wait()
- end
- v.Material = currentMaterial
- end)
- end
- end
- wait(0.4)
- stand:Destroy()
- Stand:FireClient(player)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement