Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- INSTRUCTION:
- ------------
- 1.Create script inside part and put (code below checked name [1])
- 2.Create another script inside part and put (code below checked name [2])
- 3.Create BodyPosition inside part and don't change name of BodyPosition!
- 4.Change attributes of BodyPosition P=3000
- 5.Run!
- my profile:
- https://www.roblox.com/users/140427102/profile
- Enjoy!
- --]]
- --[1]----
- local part = script.Parent
- local humanoid = nil
- local torso = nil
- local debounce = false
- local part = script.Parent
- local humanoid = nil
- local torso = nil
- local debounce = false
- while wait(0.010) do
- for i,v in pairs(game.Workspace:GetChildren()) do
- humanoid = v:FindFirstChild("Humanoid")
- torso = v:FindFirstChild("UpperTorso")
- if torso and humanoid and humanoid.Health > 0 then
- if (part.Position - torso.Position).Magnitude <= 50 then
- part.CFrame = CFrame.new(part.Position,torso.Position)
- if part:FindFirstChild("BodyPosition") and (humanoid.Health > 0 or humanoid.Health > 2) then
- part.BrickColor = BrickColor.Red()
- part.BodyPosition.Position = torso.Position
- end
- else
- part.CFrame = CFrame.new(part.Position,Vector3.new(51, 2.5, 98))
- part.BrickColor = BrickColor.new(163, 162, 165)
- if part:FindFirstChild("BodyPosition") then
- part.BodyPosition.Position = Vector3.new(51, 2.5, 98)
- end
- end
- elseif humanoid and humanoid.Health <= 0 then
- part.CFrame = CFrame.new(part.Position,Vector3.new(51, 2.5, 98))
- part.BrickColor = BrickColor.new(163, 162, 165)
- if part:FindFirstChild("BodyPosition") then
- part.BodyPosition.Position = Vector3.new(51, 2.5, 98)
- end
- end
- end
- end
- ------------------
- --[2]----
- local part = script.Parent
- local bs = nil
- local debounce = false
- local function onTouched(otherPart)
- bs = otherPart.Parent:FindFirstChild("Humanoid")
- if bs and debounce == false then
- debounce = true
- bs:TakeDamage(10)
- wait(3)
- debounce = false
- end
- end
- part.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement