I need a little bit of help to script

Hello !

I need a little bit of help I am trying to do a game like JailBreak.
So I decided when someone is going into the prisoner team they have a chance of 30% to get a Keycard But…I m not that good at scripting. Could anyone help me with the script please ?

Thank You for reading this ! :grin:

1 Like
PrisonerTeamInstance.PlayerAdded:Connect(function(Player) -- listen for player to join team
    if math.random(10) <= 3 then -- use math.random to generate a 30% chance
        keycardInstance:Clone().Parent = Player.Backpack -- clone the tool into the player's inventory
    end
end)
3 Likes

You’re supposed to post a script for people to help you with, not make the script for you.

5 Likes

You cannot ask people to make scripts here on devforum its against the rules.

3 Likes

Oh well I never knew that I m new.

Thank you so much I hope it will help I ll try now :smiley:

Ok Thank you !
I will do that.

1 Like