How To Make A Npc Kill Reward Script in Roblox Studio

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'll show you how to earn coins by killing NPCs also feel free to check out my video on the NPC respawn script titled how to make a respawning NPC in Roblox studio now enough talking let's start the tutorial as the first step you need to add a script to your NPC by clicking on the plus button this script Begins by defining the NPC variable which refers to the parent of the script presumably the NPC itself next it assigns the humanoid object within the NPC to the humanoid variable by using the find first child method the script then sets up an event listener for when the humanoid dies using the died event when the humanoid dies the script executes a function within this function it attempts to find an object value child of the humanoid which represents the killer if this object value exists and its value property is a player the script proceeds the script assigns the player who killed the NPC to the player variable it then attempts to find a leader stats object within the player's character if the leader stats object exists the script looks for a coins object within leader stats if the coins object is found the script increments its value property by 10 effectively awarding 10 coins to the player who killed the NPC then create a leader stats and data store script by inserting my script which I have Linked In the video description let's test the script as you can see the player receives coins when they kill an NPC if you use the respawn script that I created in my previous video farming coins will be much faster thank you for watching if you enjoyed the video please subscribe and leave a like see you next time
Info
Channel: 1 Minute Roblox
Views: 171
Rating: undefined out of 5
Keywords: #roblox, robloxstudio, robloxstudiotutorial, robloxstudiotutorials, npc, robloxnpc, robloxscripting, scripting, #rewardsysystem, #rewardroblox, #robloxrewardsystem, #npcreward
Id: zctTPVjW2DA
Channel Id: undefined
Length: 2min 31sec (151 seconds)
Published: Tue May 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.