ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 12 Apr 2013 08:11 PM |
Post your scripts here! Say the script and what it does. Please, no scripts over 40 lines. Any spam or tricks will be reported. Here's my script to get a wood brick to catch on fire:
function onTouch(part) if part.Material == "Wood" then script.Parent.Fire:clone().Parent = part end end
script.Parent.Touched:connect(onTouch)
Whereas the script is inside a wooden brick with fire as one of its children. |
|
|
| Report Abuse |
|
|
| |
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 12 Apr 2013 08:14 PM |
int main(){int x[3];for(int i=0;i<=3;i++){x[i]=4;}}
try that it works |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:15 PM |
@Dr: I lol'd.
@OP: Here's a script I wrote earlier: do oldtostring = tostring export tostring = (arg) -> if type(arg) != "table" then return oldtostring arg s = "" for k, v in pairs arg ks = if type(k) == "string" then k elseif type(k) == "number" then "" else "["..tostring(k).."]" s ..= if ks != "" then ks.." = " else "" s ..= if type(v) == "string" then "\""..v.."\"" else tostring(v) s ..= if ks == "" then "," else ";" s ..= " " return "{ }" if s == "" else "{"..s\sub(1, -3).."}" |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 12 Apr 2013 08:16 PM |
| State what the script does. Otherwise it is considered as a trick. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Apr 2013 08:16 PM |
@Dr You forgot namespace and iostream :( and you never ended the function |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:18 PM |
@Force: It overrides the tostring function to provide nice table output, though MoonScript's library does provide a function for you.
@Cnt: No, just no. |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 12 Apr 2013 08:19 PM |
@cnt
I legititmately face palmed. I mean really... |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:21 PM |
| You obviously don't know C++. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Apr 2013 08:22 PM |
int main(){ int x[3] for(int i=0;i<=3;i++){ x[i]=4; }
^That's what he wrote, he didn't close int main(), or he could just remove the squiggle after the i++ since it's 1 line of code after. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:23 PM |
| He ended the first curly brace. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
coplox
|
  |
| Joined: 07 Jun 2008 |
| Total Posts: 3252 |
|
|
| 12 Apr 2013 08:24 PM |
local function dec2Bin(dec) dec=dec*2 local bin="" for i=0,7 do dec=math.floor(dec/2) bin=bin..tostring(math.ceil(dec%2)) end return string.reverse(bin) end
Takes a supplied byte and returns it's bitpattern as a string. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:26 PM |
A rectangle class for Love2d class Rectangle new: (x, y, w, h) => @x = x @y = y @w = w @h = h
draw: => love.graphics.setColor 255, 0, 0 love.graphics.rectangle "fill", @x, @y, @w, @h
rect = nil
love.load = -> print "Loading" rect = Rectangle 5, 10, 100, 20
love.update = (dt) -> return
love.draw = -> rect\draw! |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 12 Apr 2013 08:27 PM |
"int main(){int x[3];for(int i=0;i<=3;i++){x[i]=4;}}"
See how there are two braces at the end? One for the function, one for the for loop. Plus I didn't need to use any of the iostream standard namespace functions because all I did was allocate and assign memory. :p |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Apr 2013 08:27 PM |
@DrHaximus I copied it wrong :( |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2013 08:29 PM |
"State what the script does. Otherwise it is considered as a trick."
Can't you just read the script to know what it does? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 12 Apr 2013 08:32 PM |
| Then you learn Spanish, silly. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Apr 2013 08:34 PM |
I'm in spanish 1 at school, silly!
|
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 12 Apr 2013 08:36 PM |
| You don't have to learn at school. I'm learning Japanese outside of school. |
|
|
| Report Abuse |
|
|
DrHaximus
|
  |
| Joined: 22 Nov 2011 |
| Total Posts: 8410 |
|
|
| 12 Apr 2013 08:36 PM |
A window with C++'s SFML library, which also has a button for closing the window and a background image. I didn't test it, but it's most likely bug free.
I have to post a pastebin because Roblox errors if I try and post it :p
pastebin/ggUkCAqV |
|
|
| Report Abuse |
|
|