Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lplayer = game.Players.LocalPlayer.Name
- warn("xXGokyXx's auto fight script loaded, you now should auto fight any enemies you get into a battle with!")
- warn('This should only have to be executed once. If it stops working let me know.')
- function battle()
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle:FindFirstChild('Enemy1') ~= nil then
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy1.Health.Value > 0 then
- game.ReplicatedStorage.RemoteEvents.BattleEvents.BattleClick:InvokeServer(game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy1)
- end
- end
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle:FindFirstChild('Enemy2') ~= nil then
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy2.Health.Value > 0 then
- game.ReplicatedStorage.RemoteEvents.BattleEvents.BattleClick:InvokeServer(game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy2)
- end
- end
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle:FindFirstChild('Enemy3') ~= nil then
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy3.Health.Value > 0 then
- game.ReplicatedStorage.RemoteEvents.BattleEvents.BattleClick:InvokeServer(game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy3)
- end
- end
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle:FindFirstChild('Enemy4') ~= nil then
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy4.Health.Value > 0 then
- game.ReplicatedStorage.RemoteEvents.BattleEvents.BattleClick:InvokeServer(game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy4)
- end
- end
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle:FindFirstChild('Enemy5') ~= nil then
- if game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy5.Health.Value > 0 then
- game.ReplicatedStorage.RemoteEvents.BattleEvents.BattleClick:InvokeServer(game.ReplicatedStorage.PlayerFolder[lplayer].CurrentBattle.Enemy5)
- end
- end
- end
- while wait() do
- if game.ReplicatedStorage.PlayerFolder[lplayer]:FindFirstChild('CurrentBattle') ~= nil then
- battle()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement