Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AcidRainDamage(AcidRainEnabled)
- if AcidRainEnabled == true then
- print("Acid Rain Damage Enabled")
- local climateManager = getClimateManager()
- if climateManager:isRaining() and getPlayer():isOutside() and getPlayer():getVehicle() == nil then
- local intensity = GetRainIntensity() * 10
- local player = getPlayer()
- local bodyDamage = player:getBodyDamage()
- local randomPart = bodyDamage:getBodyPart(BodyPartType.getRandom())
- randomPart:AddDamage(intensity)
- randomPart:setAdditionalPain(intensity * 2)
- if RandomInt(100, 1) == 100 then
- randomPart:setBurned()
- end
- if RandomInt(100, 1) > 98 then
- player:Say(HurtMessageCreate())
- end
- end
- end
- end
- function GetRainIntensity()
- return math.max(getClimateManager():getRainIntensity())
- end
- function RandomInt(maxValue, minValue)
- return ZombRand(maxValue) + minValue
- end
- function HurtMessageCreate()
- local hurtMessages = {
- "It burns, it burns!",
- "Agh, fuck! My skin!",
- "Need shelter...",
- "*Fizzles*",
- "I'm melting..."
- }
- return hurtMessages[RandomInt(#hurtMessages, 1)]
- end
- function HandleServerCommand(module, command, args)
- if module ~= "MyMod" then return end
- if command == "MyCommand" then
- AcidRainDamage(args)
- end
- end
- Events.OnServerCommand.Add(HandleServerCommand)
- Events.EveryOneMinute.Add(AcidRainDamage)
Add Comment
Please, Sign In to add comment