Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//Local Script for Summon
- local Player = game.Players.LocalPlayer
- local rp = game:GetService("ReplicatedStorage")
- local Stand = rp:WaitForChild("Stand")
- local UIS = game:GetService("UserInputService")
- local debounce = false
- local active = false
- UIS.InputBegan:Connect(function(input,isTyping)
- if isTyping then
- return
- elseif input.KeyCode == Enum.KeyCode.E then
- if debounce == false and active == false then
- debounce = true
- Stand:FireServer(active)
- end
- end
- end)
- UIS.InputBegan:Connect(function(input,isTyping)
- if isTyping then
- return
- elseif input.KeyCode == Enum.KeyCode.E then
- if debounce == true and active == false then
- active = true
- Stand:FireServer(active)
- end
- end
- end)
- Stand.OnClientEvent:Connect(function()
- wait(1)
- debounce = false
- active = false
- end)
- --//Server Script for Summon
- local rp = game:GetService("ReplicatedStorage")
- local Stand = rp: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 Mystand = script:WaitForChild("Dummy"):Clone()
- Mystand.Parent = Folder
- Mystand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
- local animControl = Mystand:WaitForChild("AnimControl")
- local idle = animControl:LoadAnimation(script:WaitForChild("Idle"))
- idle:Play()
- local weld = Instance.new("ManualWeld")
- weld.Name = "Stand Weld"
- weld.Part0 = Mystand:WaitForChild("HumanoidRootPart")
- weld.Part1 = HumanoidRP
- weld.C0 = Mystand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
- weld.Parent = weld.Part0
- end
- end)
- Stand.OnServerEvent:Connect(function(player,active)
- if active == true then
- local Character = player.Character
- local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
- local myStand = workspace:WaitForChild(player.Name.." Stand")
- myStand:Destroy()
- Stand:FireClient(player)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment