How do i script that ?
The action that you want requires a Touched event, and the cloning method. You need to put a touched event into the paqrt, then clone the sword from somewhere and place it in the player's inventory. To find the player from the character, use the GetPlayerFromCharacter method. This is all the help you will recieve since this isn't a request site. Try figuring out what these are and doing it yourself. Come back if/when you have an error or still don't understand.
-Goulstem
I would search for a "Make Your Own Giver" in free models. That sounds like what you want. I would study the scripts it uses next time.