Advertisement
pawela827

Tool

May 28th, 2021 (edited)
1,657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Script do wybuchania w Roblox
  2.  
  3. Local Script: local tool = script.Parent
  4.    
  5.     local function explode(point)
  6.         local e = Instance.new("Explosion")
  7.         e.DestroyJointRadiusPercent = 0 -- Spraw, aby eksplozja była nieśmiertelna --
  8.         e.Position = point
  9.         e.Parent = workspace
  10.     end
  11.    
  12.     local function onActivated()
  13.         -- Zdobądź humanoida, który aktywował narzędzie --
  14.         local human = tool.Parent.Humanoid
  15.         -- Wezwanie eksploduje z aktualnym punktem, w który wycelowany jest Humanoid --
  16.         explode(human.TargetPoint)
  17.     end
  18.    
  19.     tool.Activated:Connect(onActivated)
  20.  
  21. Local Script:   local tool = script.Parent
  22.    
  23.     local function onTouch(partOther)
  24.         -- Najpierw spróbuj sprawdzić, czy część, której dotknęliśmy, była częścią humanoida --
  25.         local humanOther = partOther.Parent:FindFirstChild("Humanoid")
  26.         -- Zignoruj dotknięcia przez nie-humanoidy --
  27.         if not humanOther then return end
  28.        
  29.         -- Ignore touches by the Humanoid carrying the sword
  30.         if humanOther.Parent == tool.Parent then return end
  31.        
  32.         -- Zadaj trochę szkód --
  33.         humanOther:TakeDamage(5) -- Tu wpisz ile chcesz żeby obrażenia dawało --
  34.     end
  35.    
  36.     -- Uruchom animację ukośnika --
  37.     local function slash()
  38.         -- Default character scripts will listen for a "toolanim" StringValue
  39.         local str = Instance.new("StringValue")
  40.         str.Name = "toolanim"
  41.         str.Value = "Slash" -- try also: Lunge
  42.         str.Parent = tool
  43.     end
  44.    
  45.     -- Połącz wydarzenia --
  46.     tool.Activated:Connect(slash)
  47.     tool.Handle.Touched:Connect(onTouch)
  48.  
  49. Wszystko do tool te script:)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement