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
 

RPG STATS

Previous Thread :: Next Thread 
Felleman321 is not online. Felleman321
Joined: 12 Apr 2012
Total Posts: 83
31 Mar 2017 11:06 PM
I am currently working on a semi-open world RPG story based hack and slash game, and I'm in need of help with how to implement stats onto a player.

I plan to use the Value Objects (IntValue, BoolValue, etc. Those guys) to be the actual place holder for the stat.

For example: Strength = game.Workspace.NumberValue.Value

Is there a way where I would be able to move each value object from workspace (or lighting) into a player? That way I can make armors and weapons correspond with the stats on the player that possess them
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
31 Mar 2017 11:39 PM
1.) don't use lighting for storage of anything. It is lighting, not ServerStorage.
2.) Do not use XValues
3.) You are best off using locals unless you want a variable to persist out of functions
4.) You should learn to do some FilterEnabled, doing so will allow you to keep the values about a player in a single script. This script would be your daemon. Other scripts would affect the environment or communicate with the main place script.
5.) When a player dies, the whole game.Workspace.PlayerName model is reset. The items you put into it wouldn't persist.

If you decide to use the method you are doing, it would be wise to name your object accordingly. This way you can do game.Workspace.PlayerName_Strength.Value.


So like,

local makeStats = function(plr)
local Strength = Instance.new("IntValue")
Strength.Name = plr.Name .. "_Strength"
Strength.Parent = Workspace

-- et cetera
end

game.Players.PlayerAdded:connect(function(plr)
makeStats(plr)
end)


and corrections to this method is, you should be putting these in the game.Players.PlayerName.leaderstats so that you can record the information in a leaderboard if you want. If not, don't put them inside a leaderstats IntValue.
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