Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local inputEvent = ReplicatedStorage:WaitForChild("UserInput")
  3. local TweenService = game:GetService("TweenService")
  4. local fireball = ReplicatedStorage:WaitForChild("FireBall")
  5. local healingOrb = ReplicatedStorage:WaitForChild("HealingOrb")
  6.  
  7. local function input(player, key, mousePosition)
  8.  
  9. local playerCharacter = player.Character
  10.  
  11. if key == "F" then
  12. wait(1)
  13. player.mana.Value = player.mana.Value - 10
  14. wait(0.2)
  15. local clonedfireball = fireball:Clone()
  16. clonedfireball.Name = player.Name .. "'s Fireball"
  17. clonedfireball.Parent = workspace
  18. clonedfireball.Position = playerCharacter.RightHand.Position
  19. local goal = {}
  20. goal.Position = mousePosition
  21. local Distance = (playerCharacter.RightHand.Position - mousePosition).magnitude
  22. local TweenInformation = TweenInfo.new(Distance / 100, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
  23. local Tween = TweenService:Create(clonedfireball, TweenInformation, goal)
  24. Tween:Play()
  25. end
  26.  
  27. if key == "C" then
  28. player.mana.Value = player.mana.Value - 25
  29. local speed = playerCharacter.Humanoid.WalkSpeed
  30. local jump = playerCharacter.Humanoid.JumpPower
  31. playerCharacter.Humanoid.WalkSpeed = 0
  32. playerCharacter.Humanoid.JumpPower = 0
  33. wait(0.7)
  34. local clonedHealingOrb = healingOrb:Clone()
  35. clonedHealingOrb.Parent = playerCharacter
  36. clonedHealingOrb.Position = playerCharacter.PrimaryPart.Position
  37. local weld = Instance.new("WeldConstraint")
  38. weld.Parent = playerCharacter
  39. weld.Part0 = playerCharacter.PrimaryPart
  40. weld.Part1 = clonedHealingOrb
  41. clonedHealingOrb.Anchored = false
  42. player.orbActive.Value = true
  43. wait(0.8)
  44. playerCharacter.Humanoid.WalkSpeed = speed
  45. playerCharacter.Humanoid.JumpPower = jump
  46. end
  47. end
  48.  
  49. inputEvent.OnServerEvent:Connect(input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement