Advertisement
aesnike

e

Oct 22nd, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  4. local enemyFolder = workspace.dungeon.room1.enemyFolder
  5.  
  6. while true do
  7. wait(0.1) -- Adjust the wait time as needed
  8. for _, mob in pairs(enemyFolder:GetChildren()) do
  9. if mob:IsA("Model") and mob.Name == "Aggressive Lava Walker" then
  10. local mobHRP = mob:FindFirstChild("HumanoidRootPart")
  11. if mobHRP then
  12. -- Move towards the mob (or use other attack logic)
  13. humanoidRootPart.CFrame = mobHRP.CFrame
  14. -- Fire a remote event to attack or perform action
  15. game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer({
  16. -- Arguments for your attack logic here
  17. {mobHRP.Position}, -- Example argument
  18. ["animationLength"] = 0.5,
  19. ["sentAt"] = os.clock()
  20. })
  21. end
  22. end
  23. end
  24. end
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement