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: I don't get what the output is trying to say.

Previous Thread :: Next Thread 
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:01 PM
Script:

shirtid = "http://www.roblox.com/asset/?id=59644693"
game.Players.PlayerAdded:connect(function(p)
if p['Shirt Graphic']Graphic == shirtid then
local s = Instance.new("Sparkles", p.Torso)
wait(5)
s:Remove()
end
end)

Output:

Workspace.VIP Script:3: 'then' expected near 'Graphic'
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:02 PM
Do this instead:

if p['Shirt Graphic'].Graphic == shirtid then
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:05 PM
It says:

Shirt Graphic is not a valid member of Player
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
12 Sep 2011 05:06 PM
No space o:?
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:06 PM
I think ShirtGraphic is only there is the player is wearing a T-Shirt.
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:07 PM
No you don't put a space there -_-

It's wort of like this:

game.Workspace['Example Brick']Transparency

You don't need the periods.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:07 PM
if p['Shirt Graphic'].Graphic == shirtid then

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:08 PM
You need 1. I bet you don't know how to index tables.
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:08 PM
Wait, yeah there is a space in 'Shirt Graphic'. :P
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:09 PM
@swimguy it doesn't work. And you don't use a period.
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:10 PM
@stuntkid: Do you know what the script is even doing when you put []?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:11 PM
@stunt

Yes you do.

workspace['part'].Transparency = .2

No . between workspace and [, but you DO have a . after ] and before Transparency.

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:15 PM
Yes I do, when you have a space in a name you have to put ['Example Name']
And the brackets are used as periods.
Try this and try to prove me wrong :P
Insert a brick in workspace. Name it Example Brick
And insert this script under workspace:

game.Workspace['Example Brick']Transparency = 0.5

And try to prove me wrong XP
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:17 PM
I will. You use []'s when you locate an element in a table that has a string for an index. The []'s are NOT substitutes for periods, which is why you use one after the ] if you need to access something within the object you specified.

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:17 PM
LOLOK You proved me wrong XD

But I done that before in other scripts I've made and it worked fine!

But the script still doesn't work.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:18 PM
Not just for a string as an index, ATable[1] will work just fine if there is an index of 1.

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:18 PM
@stunt: U Fail so much...


When you put square brackets, you are indexing a table.

t = {h={x={"yo"}}}

print(t[h].x) -> "yo"

And I will prove you wrong also.
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:19 PM
OK I GET IT! NOW FIX THIS SCRIPT!
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:19 PM
LATEPOST
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:21 PM
Ok, I just did this in a script:

print(workspace['Base'].Transparency) --Using a .

>0

Then I did this:

print(workspace['Base']Transparency) --No .

>Mon Sep 12 17:19:58 2011 - Workspace.Script:3: ')' expected near 'Transparency'

You use a .
End of discussion

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:22 PM
I DON'T CARE ANYMORE! FIX THIS SCRIPT OR GET OUT!
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:22 PM
Wow I can't believe I just noticed you are trying to access a shirt graphic of a player.

It's in the character.
Report Abuse
stuntkid257 is not online. stuntkid257
Joined: 12 Jul 2010
Total Posts: 1394
12 Sep 2011 05:23 PM
I'm done.

<--THREAD CLOSED-->

I can't take you people.
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
12 Sep 2011 05:24 PM
Well that's bad for you, because I know how to fix it. But wutever, ur choice.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
12 Sep 2011 05:25 PM
You're getting all mad at US because you made a mistake? Seriously, I make mistakes every day and I don't ragequit when someone else tells me what I'm doing wrong...

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breather of air::]-
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