Use this Thread to ask questions and share code!
Any Code Posted on this Thread could be used if the Creator is given Credit!
Thank you!
Rules:
Stick to The thread topic.
Be helpful or be gone.
Working code for anyone interested!
You could optimize this I'm sure, and fix it up to work to your liking!
If you find anything wrong with this script, which I'm sure you will. Help and point it out!
thats what the thread is for!
Edit You might wanna check that the agent is human and not a horse.
Any Code Posted on this Thread could be used if the Creator is given Credit!
Thank you!
Rules:
Stick to The thread topic.
Be helpful or be gone.
Working code for anyone interested!
You could optimize this I'm sure, and fix it up to work to your liking!
If you find anything wrong with this script, which I'm sure you will. Help and point it out!
thats what the thread is for!
Code:
("medieval_life_starvation", # Medieval Life
[
(try_begin),
(get_max_players, ":numb_players"),
(try_for_range, ":player_id", 1, ":numb_players"),
(player_is_active, ":player_id"),
(player_get_agent_id, ":agent_id", ":player_id"),
(agent_get_slot, ":food_amount", ":agent_id", slot_agent_food_amount),
(lt, ":food_amount", 2), #":food_amount" < 2
(assign, ":starve_dmg", 15),
(store_agent_hit_points, ":hp", ":agent_id", 1),
(val_sub, ":hp", ":starve_dmg"),
(agent_set_hit_points, ":agent_id", ":hp",1),
(str_store_string, s1, "@You are Starving Eat Something!"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
(le, ":hp", 0),
(str_store_string, s2, "@You Hear Your stomach growl one last time!"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(agent_deliver_damage_to_agent, ":agent_id", ":agent_id", 100),
(try_end),
(try_end),
]),
Edit You might wanna check that the agent is human and not a horse.
Code:
(agent_is_human, ":agent_id"),