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 » Game Design
Home Search
 

How to make a value for a player?

Previous Thread :: Next Thread 
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 04:54 PM
So i'm making a FPS, and I want to make a "Primary gun" value. So when the player switches his Primary gun, only that certain player's value changes. And every one elses values stays the same. So bassicly, i'm asking for a local value I guess (I dunno)
Thank's
Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
06 Apr 2016 04:58 PM
Just put a value in each individual player. Each player is its own instance, so a value in one player won't affect another player.
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 05:03 PM
Sorry, i'm new to scripting, so... can you tell me how to do that?
Report Abuse
NICCO890 is not online. NICCO890
Joined: 04 Jun 2013
Total Posts: 339
06 Apr 2016 05:06 PM
game.Players.PlayerAdded:connect(function(plr)
if plr:FindFirstChild("What ever value") == nil then
print("making new instance")
local value = Instance.new("StringValue",plr)--Idk if you want a a string value
value.Name = "What ever name"
elseif plr:FindFirstChild("what ever value") ~= nil then
print("already has")
end)

And just change the value's value with a local script. I did this on my phone so idk if it works.
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 05:07 PM
Okay thank's! I'll let you know if that worked.
Oh and do I have to put this script in a local Script, or nah?
Report Abuse
NICCO890 is not online. NICCO890
Joined: 04 Jun 2013
Total Posts: 339
06 Apr 2016 05:08 PM
Nah, regular script in the workspace. :)
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 05:16 PM
It didn't work ;-;
Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
06 Apr 2016 05:21 PM
You're missing an end.

Just put another end before the the one with the close parentheses.
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 05:22 PM
I'll try it out, thanks
Report Abuse
MRbraveDragon is not online. MRbraveDragon
Joined: 06 Jan 2013
Total Posts: 172
06 Apr 2016 05:23 PM
Thank you sooooo much m8!
Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
06 Apr 2016 05:25 PM
No problem. Have a good day.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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