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
 

Find Values of ALL players

Previous Thread :: Next Thread 
gansest is not online. gansest
Joined: 08 Apr 2010
Total Posts: 609
04 Jun 2013 01:13 AM
Hey, I am trying to make a script, where Values are the most important objects.
I do so: Player steps on a brick, he gets a value in his Humanoid.Parent
**If a player has a value of 1, the next player touched gets a value of 2.** But no idea how to find the next player and not change others' value.

Is there something easy to solve this trouble?
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
04 Jun 2013 02:03 AM
e = Instance.new("IntValue")
e.Value = 0
e.Parent = script.Parent

script.Parent.Touched:connect(function(h)
if h.Parent.Humanoid then
local m = Instance.new("IntValue",h.Parent)
m.Name = "Namehereplawx"
m.Value = e.Value + 1
end
e.Value = e.Value + 1
end)

--Maybe?
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
04 Jun 2013 02:06 AM
Wait.
I should add a Debounce to that.

e = Instance.new("IntValue")
e.Value = 0
e.Parent = script.Parent

debounce = false

script.Parent.Touched:connect(function(h)
if h.Parent.Humanoid and debounce == false then
debounce = true
local m = Instance.new("IntValue",h.Parent)
m.Name = "Namehereplawx" --Name here
m.Value = e.Value + 1
end
debounce = false
e.Value = e.Value + 1
end)
Report Abuse
gansest is not online. gansest
Joined: 08 Apr 2010
Total Posts: 609
04 Jun 2013 05:35 AM
Thanks about that, I'll try it as soon as I can
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
04 Jun 2013 09:22 AM
local currentvalue = 0

script.Parent.Touched:connect(function(hit)
if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then
local v = Instance.new("NumberValue", hit.Parent)
v.Value = currentvalue + 1
currentvalue = v.Value
end
end)
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