-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclient.lua
65 lines (55 loc) · 1.69 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local ped = 0
local damageTester = false
-- AddEventHandler("onResourceStart", function ()
-- start()
-- end)
AddEventHandler("onResourceStop", function ()
DeleteEntity(ped)
end)
RegisterCommand("damagetester",function()
SetEntityCoords(PlayerPedId(),258.64,-1011.57,61.64)
Wait(300)
start()
end)
function startDamageTester()
Citizen.CreateThread( function()
while damageTester do
Citizen.Wait(1)
if HasEntityBeenDamagedByAnyPed(ped) then
local pped = PlayerPedId()
local damage = (GetEntityHealth(ped) + GetPedArmour(ped) - 300)
local distance = #(GetEntityCoords(ped) - GetEntityCoords(pped))
print("Damage: "..damage)
print("Shots to kill: "..(200/damage))
print("Distance: "..distance)
ClearEntityLastDamageEntity(ped)
end
if IsEntityDead(ped) then
Wait(1000)
DeleteEntity(ped)
genPed()
end
if GetEntityHealth(ped) + GetPedArmour(ped) ~= 300 then
SetEntityHealth(ped,200)
SetPedArmour(ped,100)
end
end
end)
end
function genPed()
local mHash = GetHashKey("ig_tomcasino")
RequestModel(mHash)
while not HasModelLoaded(mHash) do
Citizen.Wait(1)
end
ped = CreatePed(4,mHash,258.64,-1011.57,61.64-1,252.29,false,true)
FreezeEntityPosition(ped,true)
SetPedArmour(ped,100)
SetBlockingOfNonTemporaryEvents(ped,true)
end
function start()
genPed()
damageTester = true
Wait(150)
startDamageTester()
end