Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 23 Jul 2013 07:05 PM |
Why is this not working? :/
text = script.Parent.Text
while true do text = "Testing Aircraft" wait(3) if script.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "PlaneKit" then local pilot = script.Parent.Parent.Parent.Parent.Parent.Parent text = "Pilot: ".. pilot.Name else text = "Pilot: --" end wait(3) end
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2013 07:07 PM |
| This runs but you need to define which objects's text. |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 23 Jul 2013 07:10 PM |
I did (First Line)
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 23 Jul 2013 07:13 PM |
| Might need these () but i'm not sure it has been a long time since I did that |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 23 Jul 2013 07:15 PM |
Um where? The strings? :/
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2013 07:18 PM |
'else text = "Pilot: --"'
You don't have the closing quotation.
Seeing as you used '--' it makes the closing quote a comment. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2013 07:22 PM |
But if there is no output, then perhaps that isn't the problem.
Add a print function after this line:
if script.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "PlaneKit" then
That way you know if the if statement is returning true or not.
|
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 12:06 PM |
Wow simple mistake could ruin it all. Let me try these two tips. Thanks :D
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 12:14 PM |
The script doesn't recognize the "--" As a comment because it is inside a string :/ I tried this script:
text = script.Parent.Text
while true do text = "Testing Aircraft" wait(3) if script.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "PlaneKit" then print("We Got A Pilot :D") local pilot = script.Parent.Parent.Parent.Parent.Parent.Parent text = "Pilot: ".. pilot.Name else text = "Pilot: N/A" print("No Pilot Here D:") end wait(3) end
It prints "No Pilot Here D:" But the text doesn't change :/
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 12:28 PM |
Bump.
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 12:38 PM |
Wow all I had to do is remove the variable and it worked..
while true do script.Parent.Text = "Testing Aircraft" wait(3) if script.Parent.Parent.Parent.Parent.Parent.Parent.Name ~= "PlaneKit" then print("We Got A Pilot :D") local pilot = script.Parent.Parent.Parent.Parent.Parent.Parent script.Parent.Text = "Pilot: ".. pilot.Name else script.Parent.Text = "Pilot: N/A" print("No Pilot Here D:") end wait(3) end
Why doesn't it work with variable D:
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2013 12:39 PM |
| Or you could of put the variable above the loop |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 12:48 PM |
Um check my first try... I just removed it.
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2013 12:53 PM |
"text = script.Parent.Text" You are setting text as a string, not a reference. You could do: "text = script.Parent" and then text.Text = blahlahkeg |
|
|
| Report Abuse |
|
|
Ludici
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 640 |
|
|
| 24 Jul 2013 01:32 PM |
Oh well thanks anyways (y)
postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1 |
|
|
| Report Abuse |
|
|