Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- character = owner.Character
- object = nil
- if character:FindFirstChild("rightHand") then
- character.leftHand:Destroy()
- character.rightHand:Destroy()
- --character.head:Destroy()
- end
- if workspace:FindFirstChild("vr") then
- workspace.vr:Destroy()
- end
- local function createHand(handType)
- local hand = Instance.new("Part")
- hand.Parent = character
- hand.CFrame = character.HumanoidRootPart.CFrame
- --local we = Instance.new("WeldConstraint")
- --we.Parent = character
- --we.Part0 = character.HumanoidRootPart
- --we.Part1 = hand
- --we.Name = "vr"
- hand.Size = Vector3.new(0.4, 0.4, 1)
- hand.Transparency = 0
- hand.Color = Color3.new(1, 0.72, 0.6)
- hand.Material = Enum.Material.SmoothPlastic
- hand.CanCollide = false
- hand.Anchored = true
- hand.Name = handType
- return hand
- end
- function destroyCharacter()
- character.LeftUpperArm:Destroy()
- character.RightUpperArm:Destroy()
- character.LeftUpperLeg:Destroy()
- character.RightUpperLeg:Destroy()
- character.LowerTorso:Destroy()
- character.UpperTorso.CanCollide = true
- character.UpperTorso.Transparency = 1
- end
- local start = true
- local leftHand = createHand("rightHand")
- local rightHand = createHand("leftHand")
- head = character.Head --head = Instance.new("Part")
- head.Size = Vector3.new(0.4, 0.4, 0.4)
- head.Anchored = true
- rootpart = character.HumanoidRootPart
- rootpart.Anchored = true
- --head.Parent = character
- --head.CFrame = character.HumanoidRootPart.CFrame
- --head.Name = "head"
- head.CanCollide = false
- event = Instance.new("RemoteEvent")
- event.Name = "vr"
- event.Parent = workspace
- event.OnServerEvent:Connect(function(player,lhp,rhp,hp)
- if player == owner then
- if pho == "grab" then
- object = rhp
- if object.Anchored then object.Anchored = false end
- if object and not object.Anchored then
- object:SetNetworkOwnership(owner)
- Bool = false
- if object:GetNetworkOwner() == owner then Bool = true end
- event.FireClient(owner,"grab",Bool)
- end
- else
- if start then
- destroyCharacter()
- start = false
- end
- leftHand.CFrame = lhp
- rightHand.CFrame = rhp
- head.CFrame = hp
- rootpart.CFrame = hp
- end
- end
- end)
- --punching
- function punch(hit)
- local hi = hit.Parent:FindFirstChild("Humanoid")
- if hi then
- local target = hit.Parent
- target = target.PrimaryPart
- target.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
- hi.Health = hi.Health - 5
- end
- end
- --rightHand.Touched:Connect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement