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: My first script ever! :D

Previous Thread :: Next Thread 
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:18 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:21 PM
add wait(WhateverTimeYouwant) between each. Its better.
Report Abuse
JiggedyJam is not online. JiggedyJam
Joined: 01 Apr 2010
Total Posts: 4611
24 Jul 2012 04:21 PM
That's probably the most pointless thing ever :p
But it was done correctly, easy to read.
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:24 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:26 PM
Nah, skipping lines are better to see everything... not a cluster F.
this is adding a wait inbetween lines... just in case you didn't know.
game.Workspace.Brick.Transparency = 4
wait(1)
--blah

Report Abuse
ThatThar is not online. ThatThar
Joined: 09 Jul 2012
Total Posts: 794
24 Jul 2012 04:26 PM
while true do
wait(1)
Part.Locked = false
Part.CanCollide = true
Part.Anchored = false
wait(1)
Part.Locked = true
Part.CanCollide = false
Part.Anchored = true

end

If you don't want it all to happen in the same second, then use the above. Also, you never need to skip lines. It just makes it more organized.
Report Abuse
coolmama50544 is not online. coolmama50544
Joined: 06 Aug 2009
Total Posts: 4565
24 Jul 2012 04:26 PM
Nope
You can skip lines or no.
It's more like a style as I would say.
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:27 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:28 PM
Also, skipping lines adds a 'style' to your code... Like pros do spaces and skips and stuff.
Honestly it depends on you.
Report Abuse
coolmama50544 is not online. coolmama50544
Joined: 06 Aug 2009
Total Posts: 4565
24 Jul 2012 04:30 PM
You can also tab them if you want. It makes it look nicer.
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:31 PM
Aaah, I only use tabed when I go into parents with Variables and stuff lol
Honestly people can make the most horrible looking code and it work perfectly, while a guy writes it amazing and nothing is right lol
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:33 PM
[ Content Deleted ]
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:36 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:38 PM
Thats a Variable, thats better to keep it. Like you could do

Brick1 = game.Workspace.Part1

Then something like

Brick1.Position = Vector3.new(5,5,2)

or

Brick1.Parent = game.Lighting
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:39 PM
Now brb I got to learn these Lua stuff :

functions
function connections
Instance.new()
Vector3.new()
Color3.new()
math.random()
:Remove() -- :Destroy(). :remove() was :removed() xD
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 04:42 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 04:44 PM
If you ever need anything or need some questions, you are welcome to PM me and i'll get back to you as soon as possible. Its just if you need any extra help.
Report Abuse
ThatThar is not online. ThatThar
Joined: 09 Jul 2012
Total Posts: 794
24 Jul 2012 05:03 PM
I remember last year when the wiki was probably the worst place to learn to script because it was so outdated.
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 05:53 PM
[ Content Deleted ]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Jul 2012 05:57 PM
local Part1 = game.Workspace.Part1
function onTouch()
Part1.BrickColor = BrickColor.new("Bright red")
wait(2)
end
Part1.Touched:connect(onTouch)

Part's take BrickColor, not Color3.

† KMXD †
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 06:00 PM
[ Content Deleted ]
Report Abuse
DarkStrike3 is not online. DarkStrike3
Joined: 03 Feb 2012
Total Posts: 1263
24 Jul 2012 06:02 PM
Why local?...
Report Abuse
Yousef128 is not online. Yousef128
Joined: 24 Sep 2009
Total Posts: 6854
24 Jul 2012 06:03 PM
[ Content Deleted ]
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
24 Jul 2012 06:04 PM
Try to figure out what this does :P

function onhit(hit)
script.Parent.CFrame = CFrame.new(5,2,5)
end
script.Parent.Touched:connect(onhit)
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
24 Jul 2012 06:05 PM
To make mine harder:

script.Parent:connect(function(hit)
script.Parent.CFrame = CFrame.new(5,2,5)
end)
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