#scripting learning

1 messages · Page 1 of 1 (latest)

jagged turret
#

how do i learn scripting bc whenever i watch a video, it doesn’t help at all and idk anything i just need some help

jagged turret
#

?

errant field
#

if you never make stuff you get stuck in tutorial hell

jagged turret
#

understandable

errant field
jagged turret
#

where did u learn

#

like

#

from roblox or yt

errant field
#

and eventually with more ambitious projects youll get better

errant field
jagged turret
#

alr yeah

#

i’ll start doing that

#

thank you

errant field
#

np

warped jetty
#

;compile

print(hi)
gentle garnetBOT
#
Program Output
nil

warped jetty
#

;compile

print("hi")
gentle garnetBOT
#
Program Output
hi

tranquil gorge
#

;compile

gentle garnetBOT
#
Critical error:

You must attach a code-block containing code to your message or quote a message that has one.

tranquil gorge
#

;compile print("bro")

gentle garnetBOT
#
Critical error:

You must attach a code-block containing code to your message or quote a message that has one.

tranquil gorge
#

how??

warped jetty
#

you gotta do lua

tranquil gorge
#

;compile print("hello")

gentle garnetBOT
#
Critical error:

You must provide a valid language or compiler!

;compile c++
```
int main() {}
```

warped jetty
#

if you know how to do it

tranquil gorge
#

lua

warped jetty
#

it has to be lua

#

like

tranquil gorge
#

ik

warped jetty
#

"""lua

tranquil gorge
#

but how do i put under

warped jetty
#

except not with quotations

tranquil gorge
#

like 3 this? `

#

3 of this: `

warped jetty
#

yeah then add lua

#

infrot of it

#

then skip a line

#

then blah blah blah

tranquil gorge
#

o

#

ok

#

;compile ``` lua
print("br")

gentle garnetBOT
#
Critical error:

You must provide a valid language or compiler!

;compile c++
```
int main() {}
```

warped jetty
#

no like dont add a space

#

for it

tranquil gorge
#

so just type after lua

warped jetty
#
g````
tranquil gorge
#

;compile ```
print("bro")

gentle garnetBOT
#
Critical error:

You must provide a valid language or compiler!

;compile c++
```
int main() {}
```

warped jetty
#

do 3 `'s and add lua no space

tranquil gorge
#

;compile```lua
print("Like This?")

warped jetty
#

;compile ```lua
local text="supercalifragilisticexpialidocious"

for i=1, #text do
print(string.sub(text,0,i))
end```

gentle garnetBOT
#
Program Output
s
su
sup
supe
super
superc
superca
supercal
supercali
supercalif
supercalifr
supercalifra
supercalifrag
supercalifragi
supercalifragil
supercalifragili
supercalifragilis
supercalifragilist
supercalifragilisti
supercalifragilistic
supercalifragilistic
warped jetty
tranquil gorge
#

why did it not print then

warped jetty
#

redo it

tranquil gorge
#

;compile ``` lua
print("lua")

gentle garnetBOT
#
Critical error:

You must provide a valid language or compiler!

;compile c++
```
int main() {}
```

tranquil gorge
#

oops

#

now its just not making a new line

#

wait

warped jetty
#

its 3 's add lua no space then press enter

tranquil gorge
#

;compile ```lua
print("how")

gentle garnetBOT
#
Critical error:

You must provide a valid language or compiler!

;compile c++
```
int main() {}
```

tranquil gorge
#

alr

#

;compile ```lua
print("k")

gentle garnetBOT
#
Program Output
k

tranquil gorge
#

;compile ```lua
while true do
wait(1)
print("Alr")

gentle garnetBOT
#
Program Output
/opt/wandbox/lua-5.4.7/bin/lua: prog.lua:3: 'end' expected (to close 'while' at line 1) near <eof>

warped jetty
#
local text="s,u,p,e,r,c,a,l,i,f,r,a,g,i,l,i,s,t,i,c,e,x,p,i,a,l,i,d,o,c,i,o,u,s"

for i=1, #text do
  print(string.sub(text,0,i))
 end```
tranquil gorge
#

;compile ```lua
while true do
wait(1)
print("ok")
end

gentle garnetBOT
#
Program Output
/opt/wandbox/lua-5.4.7/bin/lua: prog.lua:2: attempt to call a nil value (global 'wait')
stack traceback:
prog.lua:2: in main chunk
[C]: in ?

warped jetty
#

oh yeah it doesn't automatically add ends

#

pretty sure wait() is roblox function

tranquil gorge
#

ye

warped jetty
#

and task library

#

or sum

#

;compile ```lua
local text="s,u,p,e,r,c,a,l,i,f,r,a,g,i,l,i,s,t,i,c,e,x,p,i,a,l,i,d,o,c,i,o,u,s"

for i=1, #text do
print(string.sub(text,0,i))
end```

gentle garnetBOT
#
Program Output
s
s,
s,u
s,u,
s,u,p
s,u,p,
s,u,p,e
s,u,p,e,
s,u,p,e,r
s,u,p,e,r,
s,u,p,e,r,c
s,u,p,e,r,c,
s,u,p,e,r,c,a
s,u,p,e,r,c,a,
s,u,p,e,r,c,a,l
s,u,p,e,r,c,a,l,
s,u,p,e,r,c,a,l,i
s,u,p,e,r,c,a,l,i,
s,u,p,e,r,c,a,l,i,f
s,u,p,e,r,c,a,l,i,f,
s,u,p,e,r,c,a,l,i,f,
tranquil gorge
#

;compile ```lua
local thing = 1
thing = thing + 5
print(thing)

gentle garnetBOT
#
Program Output
6

warped jetty
#

;compile

local x,y=9,8

print(x*y)
gentle garnetBOT
#
Program Output
72

tranquil gorge
#

i try a table

#

;compile ```lua
local table = {
thing = 1,
thing2 = 2
}
print(table[thing])

gentle garnetBOT
#
Program Output
nil

tranquil gorge
#

??

#

whats wrong

#

@warped jetty

warped jetty
#

table is a code

#

table.insert table.clear table.remove and other stuff

tranquil gorge
#

but how do you get value

#

of thing

warped jetty
#

;compile

local myTable={
thing1=1,
thing2=2,
}
print(myTable)```
gentle garnetBOT
#
Program Output
table: 0x6176fdaacee0

warped jetty
#

oh yeah

#

i forgot that you actually have to do stuff to print tables

tranquil gorge
#

i meant 1 of the alues in there

#

values

warped jetty
#

because roblox has a built in table function

tranquil gorge
#

o

warped jetty
#

;compile

local myTable={
thing1=1,
thing2=2,
}
print(myTable[thing1])
gentle garnetBOT
#
Program Output
nil

tranquil gorge
#

see

warped jetty
#

thing1 doesn't exist as a variable

#

its just in the table

#

;compile

local myTable={
thing1=1,
thing2=2,
}
print(myTable[1])```
gentle garnetBOT
#
Program Output
nil

warped jetty
#

;compile

local myTable={
[“Thing2”]={number=2},
[“Thing3”]={number=5},
}
for i, v in pairs(myTable) do
    print(v,i)
end```
gentle garnetBOT
#
Program Output
/opt/wandbox/lua-5.4.7/bin/lua: prog.lua:2: unexpected symbol near '<\226>'

tranquil gorge
#

wait

#

why cant we call an individial value

warped jetty
#

like i said

#

roblox has a built-in table function

#

but others do not

#

thats why when you try to print "myTable" it does table: x0dfs8f0ds8f80xsf8d0s

tranquil gorge
#

so how you do it here?

tranquil gorge
#

i meant like print a single value

warped jetty
twin scroll
#

practice

normal swallow
#
local text = tostring(io.read())
local fulltext = ""

for v in text:gmatch(".") do
    fulltext = fulltext .. v
    print(fulltext)
end
normal swallow
gentle garnetBOT
#
Program Output
p
pe
pea
pean
peanu
peanut
peanut 
peanut b
peanut bu
peanut but
peanut butt
peanut butte
peanut butter
peanut butter 
peanut butter &
peanut butter & 
peanut butter & j
peanut butter & je
peanut butter & jel
peanut butter & jell
peanut butter & jell
normal swallow
#

It stops due to limits

gentle garnetBOT
#
Program Output
b
ba
bac
baco
bacon
bacons
bacons 
bacons n
bacons ni
bacons nic
bacons nice

spare wasp
#

Check out developpers forums and documentations

warped jetty
#

;compile

local text =“blah1234567890”

for i=1, #text do
    print(string.sub(text,0,i)
end
gentle garnetBOT
#
Program Output
/opt/wandbox/lua-5.4.7/bin/lua: prog.lua:1: unexpected symbol near '<\226>'

warped jetty
#

;compile

local text =“blah”

for i=1, #text do
   print(text)
end
gentle garnetBOT
#
Program Output
/opt/wandbox/lua-5.4.7/bin/lua: prog.lua:1: unexpected symbol near '<\226>'

warped jetty
#

Now it doesnt wanna work

#

im not on pc 😔

errant locust
normal swallow
warped jetty
#

this works wdym

warped jetty
normal swallow
warped jetty
#

#text is the amount of characters in it

#

just like how #table is the amount of things inside it