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
 

Why doesn't this work as writen?

Previous Thread :: Next Thread 
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
30 Jan 2013 09:01 PM
This code here:

Flag:BreakJoints();
Flag.CanCollide = true;
Flag.Anchored = true;
Flag.CFrame = CFrame.new(Flag.Position)*CFrame.Angles(0,0,-math.pi/8);

is located inside a function. Flag is defined, and welded to a Player's back, which is what the BreakJoints(); is for.
The code 'executes' but does not work.

However, if I add prints, like so:

print("DropFlag running");
Flag:BreakJoints();
print("Back weld broken");
Flag.CanCollide = true;
print("Collidable");
Flag.Anchored = true;
print("Anchored");
Flag.CFrame = CFrame.new(Flag.Position)*CFrame.Angles(0,0,-math.pi/8);
print("Rotated");

It suddenly starts working.

Can anybody explain to me why?
Report Abuse
commander200 is not online. commander200
Joined: 03 Feb 2009
Total Posts: 19
30 Jan 2013 09:03 PM
I'd hate to go on a tangent but may you teach me how to code? I really want to know. :'(
Report Abuse
RubiksCubix is not online. RubiksCubix
Joined: 04 Dec 2009
Total Posts: 4243
30 Jan 2013 09:04 PM
Perhaps...

Honestly, that is weird.
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
30 Jan 2013 09:06 PM
There shouldn't be any reason why you'd need to put prints in there for it to work. I'd just test out other parts around it that may have gotten changed.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
30 Jan 2013 09:06 PM
The question really isn't a 'may' as you asked but a 'can', and I cannot.

I'm not a good teacher, and I don't have the time even if I was, sorry.
Read up what you can on wiki.roblox.com; I'll be adding some game creation tutorials in the summer, so be sure to look out for those.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 Jan 2013 09:14 PM
How did you refresh the script once you added the prints? Perhaps it was the change in how the scripts were fired.

¤ ¤ † K M <( •д• )> X D † ¤ ¤
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
30 Jan 2013 09:14 PM
@blobby;

I isolated what was breaking it to a function connection beneath a coroutine for some rotation, fixed that, and it rotated.
I then removed the prints()s and it stopped working.

I'm going to assume ROBLOX is being and carry on as usual, thanks anyway.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
30 Jan 2013 09:21 PM
I'm starting 'Play Solo' test mode for each update to the script.
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