Help with workshop

Do you guys know how you can make chances? I try to make a game that if you shoot your primary fire you have 50% to die. How do I do that?

Did simple example for you. You are welcome.

AKPEA

I dont know your task and what project you developing, but its one of the way to do this. If you press Primary Fire generating chance from 0 to 100% of your death, you can change it anytime from 50% to anything else.

Also added HUD text of chance shooted bullet and respawn.

But the problem is if you holding the button each next shoot will be not triggered, so you need to press Primary Fire button each time for new trigger.

One way - to do Is Button Held and set timer Wait(0,5) and Loop for generate new chance each 0,5 sec (because, as example, Torbjorn have ~2 shoots per second, so he can be killed from each shoot of weapon). But the different chars have different shoot rate, so you need to do this thing for each char. But if this code enough for you, okay.

chanses is the simplest thing i know. Set player variable A==0. If player variable A==1 -> Kill event player .IF firing primary set player variable random integer from 1-1( 100%), from 1-2 ( 50%), from 1-3 ( 33%), from 1-4 ( 25%) etc.

Thank you so much! I will try it soon