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: Why Won't This work?

Previous Thread :: Next Thread 
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:30 PM
So it's suppose to change the value when good == false, but it doesn't.

while true do
wait()
local good = false
for _,v in pairs(game.Players:GetChildren()) do
alive = v:FindFirstChild("Alive")
if alive == false then
if v.Name == script.Parent.ChosenValue.Value then
if v.Alive.Value == true then
good = true --a player is alive
end
end
end
end
if good == false then
---no players are alive
script.Parent.Game.Value = false
end
end
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:36 PM
anyone?
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
12 Apr 2014 08:40 PM
YOU STOLE MY SCRIPT! SCRIPT STEALER!
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:40 PM
No....
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:40 PM
You have to set v.Alive.Value = true in order for the script to continue.
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
12 Apr 2014 08:41 PM
Liez. TheGamer101 Replied to me with this. You obviously did not use it right.
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:43 PM
I have it set true, still, doesn't work.
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:43 PM
No, if you read it correctly, there is one line that performs an IF function "if v.Alive.Value == true then". But nowhere else in the script is there a "v.Alive.Value = true". So it returns false and ends the script.
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:46 PM
Make the variable "alive" localized.

And for the v.Alive.Value, just use alive.Value.
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:48 PM
I have this, still doesn't work.
while true do
wait()
local good = true
local v.Alive.Value = true
for _,v in pairs(game.Players:GetChildren()) do
alive = v:FindFirstChild("Alive")
if alive == false then
if v.Name == script.Parent.ChosenValue.Value then
if v.Alive.Value == true then
good = true --a player is alive
end
end
end
end
if good == false then
---no players are alive
script.Parent.Game.Value = false
end
end
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:50 PM
while true do
wait()
local good = false
for _,v in pairs(game.Players:GetChildren()) do
alive = v:FindFirstChild("Alive")
if alive == false then
if v.Name == script.Parent.ChosenValue.Value then
if alive.Value == true then
good = true --a player is alive
end
end
end
end
elseif good == false then
---no players are alive
script.Parent.Game.Value = false
end
end
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:51 PM
It says error at line 14 in Studio
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:51 PM
It will also help you a lot if you have the Output window open. It's located the "view" tab.
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:53 PM
Doesn't show anything in output.
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 08:53 PM
while true do
wait()
local good = false
for _,v in pairs(game.Players:GetChildren()) do
alive = v:FindFirstChild("Alive")
if alive == false then
if v.Name == script.Parent.ChosenValue.Value then
if alive.Value == true then
good = true --a player is alive
end
end
elseif good == false then
---no players are alive
script.Parent.Game.Value = false
end
end
end
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 08:58 PM
Doesn't work still
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 09:00 PM
Why?
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 09:06 PM
I fixed it
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 09:15 PM
Make sure BoolValue "Alive" is true. And I'm assuming that the players don't start out dead. so good would have to be set to true. Hopefully this will work. If not, then I can't really help much more unless I had the actual model.



local good = true

while wait() and script.Parent.Game.Value == true do

for _,v in pairs(game.Players:GetChildren()) do
local alive = v:FindFirstChild("Alive")
if alive.Value == false and v.Name == script.Parent.ChosenValue.Value then
good = false
elseif alive.Value == true and v.Name == script.Parent.ChosenValue.Value then
good = true
end
end
if good == false then
script.Parent.Game.Value = false
end
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
12 Apr 2014 09:16 PM
Great! I hope I was able to help.
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 10:07 PM
Oh no. It still doesn't work.
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
12 Apr 2014 10:21 PM
Does anyone know?
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
13 Apr 2014 10:21 PM
Help!
Report Abuse
2unknown2 is not online. 2unknown2
Joined: 30 Oct 2011
Total Posts: 9351
13 Apr 2014 10:22 PM
while true do
wait()
local good = false
for i,v in pairs(game.Players:GetChildren()) do
alive = v:FindFirstChild("Alive")
if alive.Value == false then
if v.Name == script.Parent.ChosenValue.Value then
if v:findFirstChild("Alive").Value == true then
good = true --a player is alive
end
end
end
end
if good == false then
---no players are alive
script.Parent.Game.Value = false
end
end
Report Abuse
georgeba is not online. georgeba
Joined: 29 Oct 2011
Total Posts: 1092
13 Apr 2014 10:31 PM
It doesn't understand alive on line 6
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