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
 

Re: Help [4]

Previous Thread :: Next Thread 
xShenanigans is not online. xShenanigans
Joined: 23 Jul 2012
Total Posts: 209
25 Jul 2012 04:33 AM
while script.Parent.Owner ~= ("Nobody") do
wait(10)
--need to find owner in Players
end
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:34 AM
?
Report Abuse
xShenanigans is not online. xShenanigans
Joined: 23 Jul 2012
Total Posts: 209
25 Jul 2012 04:36 AM
I don't know how to find a player if they are not touching a part. The script can find which player they are supposed to find from script.Parent.Owner.
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:43 AM
while script.Parent.Owner ~= ("Nobody") do
wait(10)
players = game.Players:GetChildren()
for i = 1, #players do
if player[i].Name == "" then
--stuf here
end
end
end

Like this?
Report Abuse
xShenanigans is not online. xShenanigans
Joined: 23 Jul 2012
Total Posts: 209
25 Jul 2012 04:49 AM
while script.Parent.Owner ~= ("Nobody") do
wait(10)
players = game.Players:GetChildren()
for i = 1, #players do
if player[i].Name == "" then
--stuf here
end
end
end


I am not sure why you have to get all the players. I want to change only ONE of there stats. But according to this I assume the 'if player[i].Name == "" then' is to locate the one player I want.

So this works?

if player[i].Name == script.Parent.Owner.Value then
player[i].leaderstats.Munny.Value = player[i].leaderstats.Munny.Value + Script.Parent.Munny.Value

(The munny in player and the munny in script.parent ARE diffrent munnys)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 04:52 AM
while script.Parent.Owner ~= ("Nobody") do
wait(10)
players = game.Players:GetChildren()
for i = 1, #players do
if player[i].Name == "" then
if player[i].Name == script.Parent.Owner.Value then
player[i].leaderstats.Munny.Value = player[i].leaderstats.Munny.Value + Script.Parent.Munny.Value
end
end
end


This propably works but maybe you have a faulth in the while loop (top line). You know ~= means (is not equal to).
Report Abuse
xShenanigans is not online. xShenanigans
Joined: 23 Jul 2012
Total Posts: 209
25 Jul 2012 05:02 AM
Here is the one that does what I wanted it to do... I had to make a few adjustments to make it work.

while script.Parent.Owner ~= ("Nobody") do
wait(10)
players = game.Players:GetChildren()
for i = 1, #players do
if players[i].Name == script.Parent.Owner.Value then
players[i].leaderstats.Munny.Value = players[i].leaderstats.Munny.Value + script.Parent.Munny.Value
end
end
end

Thanks for your help again!
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
25 Jul 2012 05:15 AM
Ya I forgot to remove a line.
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