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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Simple Script not Working..(No Output)

Previous Thread :: Next Thread 
Ludici is not online. 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
LogicalOre is not online. LogicalOre
Joined: 15 Jul 2013
Total Posts: 32
23 Jul 2013 07:07 PM
This runs but you need to define which objects's text.
Report Abuse
Ludici is not online. 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 is not online. 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 is not online. 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
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
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
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
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