Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make something "chanced" of dropping an item on death?

Basically, I am a beginner at scripting. I have made it able to drop a weapon on death, but it will do it constantly. How can I make it so there's a chance of it dropping?

1 answer

✓ Accepted answer

Set the code on line 3 to the number you want. 0 being impossible, 1 being inevitable, 0.5 being 50/50 and so on.

Script:

math.randomseed(tick()) -- put at BEGINNING of script to make it even more random

if math.random() > 0.5 then
	-- code
end

1 comment

0

Thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.