generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: RPG Help?

Previous Thread :: Next Thread 
AlternativeAcc is not online. AlternativeAcc
Joined: 29 Mar 2012
Total Posts: 1337
04 Apr 2013 12:05 PM
Hi, I need help with an RPG game I am working on. I have a sword that has a debounce so that you don't get bonus points for attacking the dead NPC's, but it counts the debounce when you attack other NPC's (so in order to get pts you have to wait the debounce time). Is there a way I could have a debounce effect just for that 1 NPC? Thanks!

-- cardgamechampion/AlternativeAcc
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
04 Apr 2013 12:09 PM
Check or the thing is dead ?

For example

script.Parent.Touched:connect(function(toucher)
if toucher.Parent:findFirstChild("Humanoid") then
if toucher.Parent.Humanoid.Health == 0 then
toucher.Parent:Destroy()
end
end
end)

That will destroy the NPC after he is death.
Report Abuse
AlternativeAcc is not online. AlternativeAcc
Joined: 29 Mar 2012
Total Posts: 1337
04 Apr 2013 12:13 PM
Thank you for that obvious solution that never came to mind for me for no reason lol. I guess I didn't do this because I wanted them to see that the NPC's health is 0 before it goes away :P. This is a great idea until I figure out how to make the debounce work for the specific NPC though, thanks!
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
04 Apr 2013 12:15 PM
You can also do this :

- Put a bool value in each NPC called 'GivesPoints'
- Check the boolean and determine or you should give points to the Player.
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
04 Apr 2013 12:17 PM
if you want the sword to NOT hit the NPC's try:

hit = [the part which the sword hitted]

if hit.Parent:findFirstChild("Humanoid") and game.Players:findFirstChild(hit.Parent.Name) then
[change health]
end

just like that :)
Report Abuse
AlternativeAcc is not online. AlternativeAcc
Joined: 29 Mar 2012
Total Posts: 1337
04 Apr 2013 12:22 PM
@veilbor

That will work fine

@sycips

No I want the NPC's to die, wait a few seconds, then regen, but I want the sword to not gain pts while the NPC is dead. I have it so that if the NPC is dead and you attack them with the sword, then you get pts. I will change that to if the NPC is dead and the GivesPoints Value is true then it will then it changes to false. This will be great.

Thank you so much Veilbor, you solved it XD!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image