Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Prison Orb (clientSided)
- local tool = script.Parent.Parent
- local player, userInputService, runService, effects, remoteEvents, mouse = game.Players.LocalPlayer, game:GetService("UserInputService"), game:GetService("RunService"), tool.Effects.Z, tool:WaitForChild("Effects").Z.RemoteEvents, game.Players.LocalPlayer:GetMouse()
- local isPressing, equipped = false, false
- local char = player.Character
- local hmrp = char.HumanoidRootPart
- globalRenderstepConnection = nil
- tool.Equipped:Connect(function()
- equipped = true
- end)
- tool.Unequipped:Connect(function()
- equipped = false
- end)
- userInputService.InputBegan:Connect(function(input, gameprocess)
- if gameprocess then return end
- if input.KeyCode == Enum.KeyCode.Z and equipped == true then
- print(player.Name.." has pressed Z. It's being held down.")
- local root = char:WaitForChild("HumanoidRootPart")
- local clientRenderstepConnection = runService.RenderStepped:Connect(function()
- local rootPos, mousePos = root.Position, mouse.Hit.Position
- root.CFrame = CFrame.new(rootPos, Vector3.new(mousePos.X, rootPos.Y, mousePos.Z))
- end)
- globalRenderstepConnection = clientRenderstepConnection
- local rootCFrame = root.CFrame
- remoteEvents:WaitForChild("ChargeAttack"):FireServer(rootCFrame)
- end
- end)
- userInputService.InputEnded:Connect(function(output, gameprocess)
- if gameprocess then return end
- if output.KeyCode == Enum.KeyCode.Z and equipped == true then
- print(player.Name.." has stopped pressing Z.")
- local rootCFrame = player.Character.HumanoidRootPart.CFrame
- local attackCFrame = rootCFrame * CFrame.new(0,0,-120)
- remoteEvents:WaitForChild("StartAttack"):FireServer(attackCFrame)
- globalRenderstepConnection:Disconnect()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement