|
| 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 |
|
|
|
| 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 |
|
|
|
| 06 Apr 2016 05:03 PM |
| Sorry, i'm new to scripting, so... can you tell me how to do that? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 339 |
|
|
| 06 Apr 2016 05:08 PM |
| Nah, regular script in the workspace. :) |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
| |
|
| |
|
|
| 06 Apr 2016 05:25 PM |
| No problem. Have a good day. |
|
|
| Report Abuse |
|
|