Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local enemyFolder = workspace.dungeon.room1.enemyFolder
- while true do
- wait(0.1) -- Adjust the wait time as needed
- for _, mob in pairs(enemyFolder:GetChildren()) do
- if mob:IsA("Model") and mob.Name == "Aggressive Lava Walker" then
- local mobHRP = mob:FindFirstChild("HumanoidRootPart")
- if mobHRP then
- -- Move towards the mob (or use other attack logic)
- humanoidRootPart.CFrame = mobHRP.CFrame
- -- Fire a remote event to attack or perform action
- game:GetService("ReplicatedStorage").dataRemoteEvent:FireServer({
- -- Arguments for your attack logic here
- {mobHRP.Position}, -- Example argument
- ["animationLength"] = 0.5,
- ["sentAt"] = os.clock()
- })
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement