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 » Scripters
Home Search
 

Re: after some help/advice with players

Previous Thread :: Next Thread 
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
07 Jan 2017 03:28 AM
hey all,

im trying to make enemy health dependant on a few factors, mostly to do with the enemys stats, but id also like it to depend on the players level, and difficulty picked.

The problem is to get such stats i would need a localscript which limits where i can put it, if i put it in playerscripts how would i use it to adjust health if the model is in workspace? or would i have to put it somewhere else to be able to call it?

Thanks


Report Abuse
CrystalFlameYT is not online. CrystalFlameYT
Joined: 17 Jul 2014
Total Posts: 222
07 Jan 2017 03:42 AM
Well, say you had it in the StarterPlayerScripts. That can be a way to target players. To get the character, there is one simple line of code to put in any script to get the localplayer's character:

character = game.Players.LocalPlayer.Character

That would select the character.

Say if you opened the workspace in a play mode (With the explorer). You would open the workspace and find models with the players names as the name of the model. Say you open that. That code above would select the model in the workspace with the players name as the model's name.
Report Abuse
LightFantom is online. LightFantom
Joined: 23 Sep 2014
Total Posts: 7830
07 Jan 2017 03:42 AM
Use remote events and remote functions




Love breeds sacrifice... which in turn breeds hatred. Then you can know pain.
Report Abuse
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
07 Jan 2017 04:08 AM
Ok, if i did that then would i be able to use character = game.Players.LocalPlayer.Character in any script even if it was in workspace and i guess it would still have to be a LocalScript?


I will have to use remote functions anyway as i want FE on as afaik i havent seen a game like im planning yet on roblox so want it to be fun and fair.
only thing is im new to remote functions so dont really know how to use them fully yet.


Report Abuse
richarro123 is not online. richarro123
Joined: 07 Nov 2015
Total Posts: 293
07 Jan 2017 04:11 AM
i just re-read your post and completely missed the bottom paragraph.

What i mean is the enemy units model would be in workspace, so i need to adjust their Health and MaxHealth with the current players lvl, so if a lvl 1 player joins the units health would be like 10hp but if a lvl 100 got the same unit it would be like 100,000hp


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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