I'm currently making a game and I wanna make it so if you finish the promixity prompt a gui will appear and i want a chance to get 3 endings Good ending (49%), Bad ending (49%), and the secret ending (2%) the numbers are the rarity to each ending (duh) and I really want this to work commenting with a script would help alot!
using math.random() will do, here's the example of the script:
local chance = math.random(1, 2) if chance == 2 then --// If chance's value is 2 then it will print "2" print("2") elseif chance == 1 then --// Else if chance's value is 1 then it will print "1" print("1") end
To make this work with proximity prompt, use ProximityPrompt.Triggered
script.Parent.Triggered:Connect(function() local chance = math.random(1, 2) if chance == 1 then print("1") elseif chance == 2 then print("2") end end)
to play the sound, simply just use Sound:Play(), to make the gui pop up, use GUI.Visible = true
comment if you have questions