#plugin-lua-and-fun

1 messages Β· Page 2 of 1

potent jolt
#

you need to restart for any changes to take effect

#

ah

#

then just save

#

also

#

reason it didnt work is cuz of your getbuilding call

#

you cant put it out there

misty python
#

it has to be in a function

#

?

potent jolt
#

yes

#

if its not in a function

#

its ran as soon as the draft is loaded

#

which is during startup

#

when youre not inside a city, when the city module wont exist

misty python
#
local randomDirection = 1
function script:nextDay()
    local slimeDraft = script:getDraft()
    local slimeCount = City.countBuildings(slimeDraft)
    local slimeX, slimeY = City.getBuilding(slimeCount, slimeDraft)
    randomDirection = math.random(1, 4)
    if randomDirection == 1 then
        Builder.buildBuilding(slimeDraft, slimeX + 1, slimeY)
    elseif randomDirection == 2 then
        Builder.buildBuilding(slimeDraft, slimeX - 1, slimeY)
    elseif randomDirection == 3 then
        Builder.buildBuilding(slimeDraft, slimeX, slimeY + 1)
    elseif randomDirection == 4 then
        Builder.buildBuilding(slimeDraft, slimeX, slimeY - 1)
    end
end
#

what is up with this weird spread

elfin geyser
#

Call script:getDraft() outside so it can cached

potent jolt
#

probably a logic problem somewhere

misty python
#

i mean

#

i can't be mad

#

the code is doing what i made it to do

#

but to be fair, this pisses me off

elfin geyser
#

Yes not bad, it's because of yiur algorithm

potent jolt
#

ah

#

chief

elfin geyser
#

Youre just getting the last slime building to be able to spread not all

potent jolt
#

youre always geting the last built piss

#

dont you want to spread all piss

misty python
#

i sure do, mate

elfin geyser
#

loop involvement

misty python
#

ah, for loop time?

#

i love those

elfin geyser
#

Yes

#

Don't forget a timer for them to dissolve after

misty python
#

wait() 🧌

elfin geyser
#

Lol

#

That's forbidden function isn't?

potent jolt
#

no dissolve

#

only piss

#

nuke it to contain

elfin geyser
#

Dangerous

misty python
#

okay so now

#

how do i make it spread in all directions

#

@potent jolt hlpe

potent jolt
#

lol

#

are you sure its not just spreading that way due to sheer chance

misty python
#

yes

elfin geyser
#

After that You may want to list all possible directions in a table so you get rid of 8lines of if statements

misty python
#

i've tested it multiple times

#

okay maybe to be more exact

#

how do i make it so all slimes do something

#

all pisses

#

piss blocks

light plinth
#

ask mojang

potent jolt
elfin geyser
#

Nahh it's just a table with 4 elements

potent jolt
#

4 elements of what though

#

and what then, check them with an if?

elfin geyser
#

No

potent jolt
#

im not putting functions in tables

misty python
#
local randomDirection = 1
local slimeDraft = script:getDraft()
function script:nextDay()
    local slimeCount = City.countBuildings(slimeDraft)
    local slimeX, slimeY = City.getBuilding(slimeCount, slimeDraft)
    randomDirection = math.random(1, 4)
    if randomDirection == 1 then
        Builder.buildBuilding(slimeDraft, slimeX + 1, slimeY)
    elseif randomDirection == 2 then
        Builder.buildBuilding(slimeDraft, slimeX - 1, slimeY)
    elseif randomDirection == 3 then
        Builder.buildBuilding(slimeDraft, slimeX, slimeY + 1)
    elseif randomDirection == 4 then
        Builder.buildBuilding(slimeDraft, slimeX, slimeY - 1)
    end
end
#

once again, what could cause only the most recent block spread

elfin geyser
#
dir = {
[1] = {-1, 1}, ... }
}

for i = 1, slimeCount do
   local x, y  = City.getBuilding(i, slimeDraft)
  local frame = Tile.getBuildingFrame(x, y)
Builder.buildBuilding(slimeDraaft,x + dir[frame][1], y + dir[frame][2])
end

Just something like

misty python
#

you know what

#

i'll revisit this tomorrow, i need sleep

potent jolt
#

and its the one with the highest index

#

you need to put your spreading code in a loop

elfin geyser
#

Ima rest too

#

Bye

uncut field
#

I use tables for that all the time

#

It's good for making switch statements

uncut field
#

Hey

elfin geyser
#

12hrs nice

potent jolt
#

i do use lookup tables

#

just when youre nesting them for something like this

#

just a bit too much if you ask me

misty python
elfin geyser
#

didnt i sent the gist?

misty python
#

let's say

#

no table

elfin geyser
#

remove the build part and put your if statements

misty python
#

screw it

elfin geyser
#

dont forget how you acquired slimeCount

#
local slimeDraft = script:getDraft()

function script:nextDay()
  local slimeCount = City.countBuilding(slimeCount)
  for i = 1, slimeCount do
    local x, y  = City.getBuilding(i, slimeDraft)
    local frame = Tile.getBuildingFrame(x, y)
    -- if statements
  end
end
misty python
#

epic coder moment

elfin geyser
#

theres still missing

misty python
#

it still spreads somewhat oddly but it's way better than before

elfin geyser
#

needs to check whether the draft was already been placed to the assumed dir

misty python
#

the slime tends to spread in the directions that are in red

#

after it spreads fully in the red directions, only then it starts to normally spread to the blue direction

elfin geyser
#

did the script attached to the building ?

random hamlet
#

show full code

elfin geyser
#

if does seems im wrong using script:nextDay() its unoptimized

misty python
# random hamlet show full code
local randomDirection = 1
local slimeDraft = script:getDraft()
function script:nextDay()
    local slimeCount = City.countBuildings(slimeDraft)
    for i = 1, slimeCount do
        local slimex, slimey  = City.getBuilding(i, slimeDraft)
        local frame = Tile.getBuildingFrame(slimex, slimey)
        randomDirection = math.random(1, 4)
    if randomDirection == 1 then
        Builder.buildBuilding(slimeDraft, slimex + 1, slimey)
    elseif randomDirection == 2 then
        Builder.buildBuilding(slimeDraft, slimex - 1, slimey)
    elseif randomDirection == 3 then
        Builder.buildBuilding(slimeDraft, slimex, slimey + 1)
    elseif randomDirection == 4 then
        Builder.buildBuilding(slimeDraft, slimex, slimey - 1)
    end
end
end
elfin geyser
#

frame var is useless

random hamlet
#

not sure about the main issue but why is i=1

#

also why are you counting from 1 and not 0

#

terrible

elfin geyser
#

lua start from 1

random hamlet
#

what

misty python
misty python
elfin geyser
misty python
#

shut up

torpid spear
#

'int expected' lower your expectations then idiot

misty python
#

smh

#

at least the random piss evaporation works

potent jolt
#

wont it just get filled by other piss

misty python
#

yes it will

#

but it's pretty much the same for the vanilla slimes

random hamlet
misty python
#

i sure do

random hamlet
#

Now do GUI

misty python
#

no

#

@light plinth does theotown support while true loops

light plinth
#

more like

#

does Lua have while true loops

#

also

misty python
#

doesn't it

light plinth
#

if you run it in update method

#

I will grab my gun

misty python
#

well uhm

#

the computer is doing what i'm telling it to do

#

actually

#

what's the purpose of the loop

#

πŸ€¦β€β™‚οΈ

light plinth
#

It does nothing

misty python
#

it was a rhetorical question

#

okay this kinda works

#

okay now the disappear script works perfectly

#

now to figure out what this means

elfin geyser
#

Your code

misty python
#
local randomDirection = 0
local randomDisappear = 0
local slimeStop = false
local slimeStopWatch = 0
local slimeDraft = script:getDraft()
function script:nextDay()
    local slimeCount = City.countBuildings(slimeDraft)
    for i = 1, slimeCount do
        local slimex, slimey  = City.getBuilding(i, slimeDraft)
        local frame = Tile.getBuildingFrame(slimex, slimey)
        randomDirection = math.random(0, 3)
        randomDisappear = math.random(0, 19)
    if randomDirection == 0 and not slimeStop then
        Builder.buildBuilding(slimeDraft, slimex + 1, slimey)
    elseif randomDirection == 1 and not slimeStop then
        Builder.buildBuilding(slimeDraft, slimex - 1, slimey)
    elseif randomDirection == 2 and not slimeStop then
        Builder.buildBuilding(slimeDraft, slimex, slimey + 1)
    elseif randomDirection == 3 and not slimeStop then
        Builder.buildBuilding(slimeDraft, slimex, slimey - 1)
    end
    if randomDisappear == 0 or slimeStop then
        Builder.remove(slimex, slimey)
    end
end
end

function script:nextMonth()
      slimeStopWatch = math.random(0,9)
      if slimeStopWatch == 0 then
          slimeStop = true
      end
end
#

f..k off dyno

potent jolt
#

the game will wait til your lua is done before rendering the next frame

#

and it has plenty of time to wait

misty python
#

wait()

weak mural
stoic vector
#

Hello, i have created a ground plugin with several textures in 1 frame for saving space

#

How do i segregate the different ground textures in the json?

random hamlet
#

but you should use "width" and "x" tags for frames

stoic vector
#

my bad

zinc isle
#

Ppunish 751066833024712754

rare grottoBOT
#
Case #2648

yeetinator07#1539 was banned for the following reason: Promotion of an NSFW server

elfin geyser
#

Nice plugin

teal dirge
elfin geyser
#

Your kind😏

frigid sparrow
serene elm
teal dirge
frigid sparrow
potent jolt
#

1984

digital kindle
potent jolt
#

dang they made the year into a real book

#

wild

elder glacier
#

no way

stoic vector
#

what

potent jolt
#

anyway lets get back on topic

elfin geyser
#

Amungus

low jewel
tight thunder
#

I need custom zone .json

tight thunder
#

Bruh i think this is where the json discussion nevermind thanks

elfin geyser
#

How could I copy a table has nested tables

#

I tried to make a new table and index values from table1 to that new table but tables inside table1 couldn't copy

#

Nvm i found solution from roblox lua

potent jolt
#

make it recursive

#

iterate over the tables fields, if the field is a table, call the copy function again

#

(inevitably deadlock on a circle reference)

elfin geyser
#

Yes yes

elfin geyser
#

Is there any method to get happiness on a certain area? Not overall but area wasn't covered with influences

elfin geyser
#

How to get the wait time of the game

potent jolt
#

elaborate

elfin geyser
#

The wait time when youre not touching any on the map

elfin geyser
#

Ghost pingu

potent jolt
#

just use script:tap

#

and compare the runtime with the last call

elfin geyser
#

my gui gets crashed when i suddenly put the game on the tabs and gets back i have no ways to fix it

spring token
#

Help i cant comprehend lua

potent jolt
#

kinda sounds like a you problem chief

spring token
#

Aw

uncut field
#

Start small, and try to find some beginner's tutorials online

#

There's plenty out there, especially because it's used for roblox

spring token
#

Imma do that, thanks

humble fjord
#

how do u spawn cars

#

like with certain id

#

buses especially

humble fjord
#

damn i found it in forums

stoic vector
#

Hi sorry if I'm In the wrong Channel but is this where you wanna know how to make plugins?

zinc isle
elfin geyser
#

@random hamlet

uniform float cityTime 😳

potent jolt
#

ah yes

#

we can do ditstance blur

elfin geyser
#

I think I'll spend a hard time to understand these thingy

#

Do webGL same as this?

potent jolt
#

no clue

#

nah definitely not

random hamlet
#

Where's that

#

(the doc)

random hamlet
#

Found it btw

elfin geyser
#

Cpp debugging in TT is what i we actually need

random hamlet
#

there is no way to debug shaders though

elfin geyser
#

Yeah

#

Hoping it will have sunday

#

Lol Sunday

#

Someday*

potent jolt
#

shaders are too low level

#

though

#

what i wouldnt give to be able to attach a lua debugger to the game

random hamlet
#

I dont think it works like this

elfin geyser
#

Since it was written in cpp

potent jolt
#

probably not

#

thats like

#

deep in the graphics engine

#

also its directly stored in the gpu memory so its not really accessible

elfin geyser
#

Sad I've read something about that lately

random hamlet
#

also most shaders (especially for theotown) dont have complex algorithms I think

elfin geyser
#

Ey ey, what's the default value of vector arguments if not defined? In shaders

#

If vec4 arguments are vec4(red, blue, green, alpha) and in lua value of (255, 255, 255, 1.0) draws the frame in original color why the default game shader was
vec4(saturation * (col.xyz - vec3(light)) + vec3(light), col.a); //this is just 2 arguments

random hamlet
elfin geyser
#

I see

#

That's handy

elfin geyser
#

i wonder if this can dynamically change via runtime

random hamlet
#

wow shader api

#

interesting

#

I love that

potent jolt
#

interesting

#

that could provide some great functionalities

#

dynamic mexico filter

elfin geyser
#

Ok found out it cannot be changed in runtime

uncut field
elfin geyser
#

Any easy way to completely make game ui invisible temporarily with lua, same way as you click 'hide ui' in settings

There's still some gui id that i didn't know so i can't make them invisible

autumn bluff
#

Can anyone teach me how to use the LUA code ??

potent jolt
#

because json is a way of defining data

#

it is not scripting

#

also, if you want to implement basic lua just read the tutorial on the forum

#

i can help you with specific steps or problems

#

but im not going to walk through the entire process

light plinth
#

Rude

potent jolt
#

look man, i have chickens to feed

elfin geyser
#

Is it good or not to keep strict lua on in production?

weak mural
#

strict lua is good for debuging, but you can't do anything.

#

not using strict will pass the error, but you don't know the error.

#

strict lua has no effect on the LuaWrapper for minor errors.

potent jolt
#

i prefer to keep it on as it makes the script fail earlier, which could make it easier to track down the issue

#

otherwise you might get cases where your script wont work anymore

#

and it might write incorrect data to storage tables

#

which could permanently brick your plugin

weak mural
potent jolt
#

also hence why complex industry is so eager to throw errors

#

i dont want to risk breaking the city storage, since thats pretty much unrecoverable

elfin geyser
#

If I'd change the file name of '.plugin' to '.mpf' and move to managed plugins folder does it will work?

#

Nvm, i see it needs a magic number

potent jolt
#

highly doubt it

elfin geyser
#

Damn i just want to debug the behavior of my plugin within

stoic vector
#

Why can't I iterate over a _ENV table?

zinc isle
#

@light plinth does that sound like?

#

he left after saying that too

#

from what ive been hearing sounds like suspicious jeremiah stuff

#

jeremiah or this account?

#

malicious links in a plugin

#

i dont remember the details, i wasnt around but someone caught me up on it a few months ago

elfin geyser
#

If he could just pretend to be an idiot, that would help for himself to stay here but no more plugin making

elfin geyser
#

Asking for environment table

light plinth
#

If you disagree and even want to be unbanned, please write a 750 word letter to pickle@theotown.com apologizing for what you have done and arguing why ENV variable should be accessible, but that does not mean we will make it accessible.

wary pewter
#

Lmao

potent jolt
#

why i should get access to the ENV variable: i asked nicely

elfin geyser
#

Emotional damage

elfin geyser
#

May i ask... Does fun functionality with build types for road deco has significant effect with multi-deco support turned on in settings.. The old way for road deco having 'type:build' for another kind of deco on its fun was it removes itself to build the called draft. I'm thinking if it stacks when the multi-deco support are involved

#

It's was Jeremiah, that's to be expected for him since he's banned

#

Let's end here my question was getting buried

weak mural
#

yeah, with itteration to extract all functions into a new module.

#

same like the draft orig. since there are no functions to change like title, text, etc, without privileged code. and only protect the object like monthly price.

elfin geyser
#

@weak mural since you mentioned .orig are attributes having space are not accessible?

#

I mean like "influence pollution"

#

Even camel case won't work in it

#

Ohh my i haven't hear that function before

weak mural
#

it return the table and you know what the next to do.

elfin geyser
#

Lemme check in the docs

#

It's not in the docs:(

#

Well i think it's a method, Thank you so much

potent jolt
#

including malicious code in his script

#

it wasnt harmful outside tt

#

it did things like exiting the application after obscure conditions were met

elfin geyser
#

We can say, he simply attacked TT

potent jolt
#

the plugins he made were decently impressive so its a bit of a shame

elfin geyser
#

What is it

#

Well i don't Download anyone's plugin as id only lunch the game to debug my work

potent jolt
#

a whole bunch of custom gui

elfin geyser
#

Ahh the revamped gui

#

I thought it has malicious code in it

potent jolt
#

i dont remember

#

pretty sure it was slow as hell though

elfin geyser
#

Pretty expected though

uncut field
#

Why does he keep coming back to a game he was banned from? I would've just abandoned this by now and moved onto something else

south garnet
#

Don't underestimate human's willingness, as well as stupidity

potent jolt
#

no idea what drives him, hes got no platform for any of his content anymore

spring token
#

Can't he just start over by pretending to be a new user? He can act like a moron at first then become very good at making plugins a few months later

#

Because ngl his plugins look cool, without the sus codes

potent jolt
#

every time he makes an alt he gives himself away really easily

elfin geyser
#

But the way he codes are still remarkable :>

elfin geyser
#

Any other way to debug local plugins in managed plugin folder?

light plinth
#

bro

#

you use plugins folder for that

elfin geyser
#

It somehow difference in some ways, like my plugin wont crash when it was in plugin folder but it crashed with the .mpf file i want to debug it there, managed folder deletes foreign file which was not in mpf format you know just to ensure it works in both format

light plinth
#

managed plugins get loaded first I think

#

Or the reverse is true

elfin geyser
#

I haven't encounter what my plugins error actually facing before, because it works well in the local plugin dir. until i download both plugin used both of my vendor files from plugin store, removing the local copies and dang i have the same issue.

potent jolt
#

well how are your "vendor files" implemented

#

that might shed some light on the issue

uncut field
light plinth
#

Since local plugins get priority

#

That's been done for development reasons

potent jolt
#

now what if we could do

#
{
"components": {
    // let's define a custom component called coolMenu
    "coolMenu": {
        // The base gui object type of the menu
        "type": "dialog", 

        // The arguments that can create the gui object
        "args": { 
            "width": 300,
            "height": 180

        },

        // Let's put some objects in the dialog's body
        "content": [
            // lets use the coolContent component, and a label
            "coolContent",

            {
                "type": "label",
                "args": {
                    "text": "line 2",
                    "height": 15
                }
            }
        ]
    },

    "coolContent": {
        "type": "layout",
        "args": {
            "vertical": true
        },
        "content": [
            // let's put some labels in the layout
            {
                // types that dont have inner content dont need the args tag
                "type": "label",
                "args": {
                    // we're gonna replace {template} with a value later
                    "text": "this is {textContent} text",
                    "h": "{labelHeight}"
                }
            },
            {
                "type": "label",
                "args": {
                    "text": "line 2",
                    "height": 15
                }
            }
        ]
    }
}
#

to define gui

#

sure be a shame if someone made that

mild thistle
#

It looks like it's been made...?

potent jolt
#

i dont think you understand what i mean

#

this functionality does not exist

#

unless i make it

light plinth
#

ask Jeremiah

mild thistle
light plinth
#

he'll make it

potent jolt
#

nah, ill do it myself

#

main issue im running into is those format strings

#

i want to replace those with runtime data

#

but i need some way to handle that

#

the idea is that you'd create the coolContent component with a labelHeight and textContent argument that would automatically be substituted into the args

weak mural
#

how to define a function, e.g. onClick, on json? bear_think

uncut field
#

@elfin geyser the discord link on your yt channel is invalid btw

elfin geyser
#

Ahh thanks

#

Fixing it

#

Is it just me or temporary and permanent invite link was removed?

elfin geyser
#

Damn i hate tge update

#

I can't find that in mobile ver

zinc isle
#

ye only pc ig

potent jolt
#

tap and hold on a channel > invite > edit invite

zinc isle
#

Oh yeah its just the letters are so tiny that it is hard to miss

#

Right below the search one

potent jolt
#

veru

potent jolt
#

been working on a gui module

#

not quite done yet

elfin geyser
#

Nice nice, whats your plan for on click function

potent jolt
#

data tags can be of any type

#

so you can use it to define an onclick as well

#

still need to write an example script for it

potent jolt
#

added an example script that used the onclick function

elfin geyser
#

'draft:getContent()' was returned in the game for data drafts i think it's better to use that as it returns the whole raw json of the draft

light plinth
#

That's not stored

elfin geyser
#

What is it mean?

light plinth
#

Raw json of drafts are not stored in the memory

#

They get loaded and immediately discarded

elfin geyser
#

But i see he used loader function of the draft at init() to store the contents (provided inside the meta table) in his module

light plinth
#

Metadata IS stored in the memory

#

Same with data drafts

#

their original contents get stored

#

Other drafts get their properties parsed and validated by the game and then raw values discarded

elfin geyser
#

Damn i can't even explain in English properly what im trying to explain, m let's settle it here

potent jolt
#

i just picked the meta table since that lets me define arbitrary data

elfin geyser
#

Makes sense

elfin geyser
#

Hey rate my optimized way for go signals timer for busses after it pickups a passenger at station, this loops was called every day

for carId, obj in pairs(CARSPEED) do
    obj.countdown = obj.countdown - 1
    if obj.countdown <= 0 then
        pcall(function() obj.car:setSpeed(obj.orig_speed) end)
        CARSPEED[carId] = nil
    end
end
#

I come up with this idea instead of relying on postpone function

weak mural
#
  1. use postpone.
  2. don't use pcall.
potent jolt
#

instead of using pcall you should just check if orig_speed is a valid input

#

pcall incurs significant overhead when it errors

#

also, you couldve done ```lua
pcall(obj.car.setSpeed, obj.car, obj.orig_speed)

#

saving the overhead of an intermediate function call

#

also generally uppercase variables names should be used for constant values

#

but thats just code style

elfin geyser
elfin geyser
potent jolt
#

my bad, thats supposed to be a comma

elfin geyser
#

I see

potent jolt
#

it passes the car as an argument

elfin geyser
#

Yes already tried it but with only 2 arg

potent jolt
#

the : notation might work but idk

elfin geyser
#

May use dot to be sure

#

But is it really true that using postpone function has affect on game performance?

potent jolt
#

of there is an effect, but is it a problem

uncut field
#

You could optimize it more if you didn't have to use pairs ()

#

I believe regular for loops are faster

#

But maybe that's not possible here

elfin geyser
#

Not possible since i used keys

uncut field
#

Oof

#

Makes sense tho

elfin geyser
#

I think it's more optimized since i don't have to iterate and compare each value to get the given id

potent jolt
#

optimization is cool and all

#

but why not take a step back and check if your script actually used a meaningful amount of frame time

#

excess optimization can really hurt readability and complexity

elfin geyser
#

There's nothing to optimize now

#

Other heavy loads was up to the user how they can minimize their transit/route count

potent jolt
#

i am questioning the need to optimize in the first place

#

unless youre doing thousands of iterations per frame

#

you dont need jt

elfin geyser
#

Well too much lua calls lags my phone

#

I know it's on my unit for some reason but at least it lessen also i considered low end devices

potent jolt
#

ive tested complex industry on my device with about 50 buildings and it had no measurable performance impact

#

and i usually get 40fps

elfin geyser
#

Im lagging with it though

#

Also it's why it's often for me to use nextDay than update()

potent jolt
#

you must be doing an excessive amount of looping then

elfin geyser
#

If i need to spend money, values having decimal does it round up?

potent jolt
#

why not just round the monthly payment value before it is saved

#

on loan creation

elfin geyser
#

Yeah i did it anyway, but it was look good to see when there's a decimal point for balances, unfortunately TT doesn't have decimals when it comes to money

elfin geyser
#

What's the difference between
setRoadOccupation() and buildRoadDeco()

light plinth
#

RoadOccupation is special type

#

RoadDeco is just road decoration

#

RoadOccupation defines rioters

#

Not sure if you can override them, but that's just things on the road such as trash, rioters, etc

#

not something user can control normally

digital kindle
#

Need some verification if this works.

local append = Array()

for i = "K3L","BL" do -- Types of wagons, passenger or baggage.
    for j = 50,60,10,16,20,22 do -- Livery dates 19/20...
      for k = 1950,1960,2010,2016,2020,2022 do --Livery dates for frames
        for l = "EKO","BAG" do -- Types of wagon for frames passenger or baggage 

          append:add('{"id": "$K012_ITPTR_'..i..''..j..'", "type": "train car", "template": "$K012_ITPTEMP_GERPEN01", "frames": [{"bmp": "Gerbong_L'..k..'_'..l..'.png","count": 4,"w": 20},{"bmp": "Gerbong_L'..k..'_'..l..'.png","w": 17,"x": 80},{"bmp": "Gerbong_L'..k..'_'..l..'.png","w": 5,"x": 97,"handle x":-3},{"bmp": "Gerbong_L'..k..'_'..l..'.png","w": 17,"x": 102},{"bmp": "Gerbong_L'..k..'_'..l..'.png","w": 5,"x": 119,"handle x":-3}],"frames per variant": 8,"chargeable": false,"animation": [{"id": "$ITP_ANI_PWAG","x": -14}]}')
        end
      end
    end
  end
local json = [[
    []]..append:join(',\n')..[[]
]]

Draft.append(json)```
potent jolt
#

why not just test it

#

also

#

you can use runtime.tojson and print it to the log

#

then inspect the output whether it is as expected

elfin geyser
potent jolt
#

i would use the lua to generate the json once, then copy it to a file

trim remnant
#

Ppunish 916640981389021224

rare grottoBOT
#
Case #2952

Frytkownica#9123 was banned for the following reason: Sharing scams or phishing content.

potent jolt
#

imagine if there was actual scripting content here

#

thatd be wild wouldnt it

wary pewter
#

Print: "hi world"

potent jolt
#

using print is bad practice, i reccomend using Debug.Toast instead

#

on a side note

#

where does print even end up

wary pewter
wary pewter
potent jolt
#

print statements get sent directly to lobbys fax machine

light plinth
#

think they appear in stdout

potent jolt
#

but is that readable anywhere

torpid spear
#

omw to print celeste lore

light plinth
potent jolt
#

look man, i dont have the source code and android studio

#

i dont have a way to view that

light plinth
#
xdg-open steam://run/1084020
#

on linux

#

with xdg

potent jolt
#

heck is xdg

light plinth
#

protocol

potent jolt
#

sounds like foss

light plinth
#

It opens the steam URL

#

no idea what's the equivalent of it on windows

#

open? run?

#

heck if I know

potent jolt
#

dont ask me

#

maybe it gets into out.txt too

light plinth
#

that's the plan

potent jolt
#

never heard of that url thing

light plinth
#

it's a steam protocol

#

You can read about it more here

#

Lets you make steam into a CLI interface

#

that makes me curious

potent jolt
#

cool

light plinth
#

now we cooking

potent jolt
#

sick jebediah kerman you got there

#

looks neat, and fast

#

bonus points if i can access screenshots and chat quickly

light plinth
#

written in rust

#

day ruined

potent jolt
#

look at this guy

#

not a fan of native performance?

light plinth
#

I feel like my nvme has been violated

#

it's rust

potent jolt
#

shouldve written it in uno

light plinth
#

I don't have uno

potent jolt
#

it came free with your copy of theotown dumbass

light plinth
#

best I can do is

potent jolt
#

finally

#

advanced programming

#

is rider any good

light plinth
#

I prefer it to vs

potent jolt
#

it happens to fall under one of the licenses i have

light plinth
#

I am more familiar with it

#

as with all jetbrains products

potent jolt
#

i see

light plinth
#

it do be using some memory tho

potent jolt
#

might give it a shot

#

eh, nothing visual studio doesnt do already

#

as long as theres the stylecop plugin for it

#

as it is required for my work

light plinth
#

why do I have community edition of intellij idea

#

smh

#

maven indexing

potent jolt
#

ballin

#

will try tomorrow

#

dont care much for the diffrent styles

#

but will see if their xaml interpreter is any better than vs

topaz bloom
#

Nice

wraith garden
#

Hello, could anyone tell me how to draw night anim on building through Lua, just like landmark 81 by anhkatori? thx a lotπŸ˜€

potent jolt
#

have you got any basic knowledge on lua?

#

your script would look a little something like ```lua

function script:draw(x, y)
-- here we can check whether it is night time

-- then draw the lighting ontop of the building
end

weak mural
#

drawCity is more friendly.

potent jolt
#

drawcity would result in the drawing getting drawn over buildings that should be infront of it

uneven knot
#

Hello how do I use this plugin

uneven knot
#

?

#

I mean how

torpid spear
#

society if plugin-scripting was used for scripting

#

there's a forum thread for the plugin that should explain most things

potent jolt
torpid spear
#

you're right we need a separate server for lua

potent jolt
#

true, this channel isnt big enough for us

acoustic silo
#

my worst plugin yet is a tool to put together the exact road you want and it works by adding hidden road drafts for EVERY possible combination during startup ._.

#

think I'll have to go for plan b and just force a restart after crafting a road and then only load the ones during startup the user wants, cause every new option right now would mean an exponential increase of roads to be loaded in lmao

#

anyone got a better idea hahaha

smoky glacier
#

That looks so good

#

You are a experienced plugin maker?

acoustic silo
#

no I bought the game like three weeks ago lmao

#

but I've already spent way too much time doing Lua stuff haha

torpid spear
#

so you just started making plugins with the most difficult thing lol

acoustic silo
#

umm yes hahahaha

#

I mean I'm comfortable with programming (tho I've never used lua before) and I fell in love with this game so why not ;p

torpid spear
#

glad you like it

#

as you can see theotown offers quite an expansive function library

acoustic silo
#

yeah definitely! Though it's quite the trial and error sometimes to figure out how something works in practice vs what's in the documentation

#

and i want to do way too much right from the start, should've started with a hello world first I guess? but nope first thing i did is some smart traffic lights haha

potent jolt
#

generally its not that bad

#

doing car related behaviours is limited for now

random hamlet
#

Theotown Lua is fun

#

Even though I'm less active in TT now I should make a few more plugins at some point

#

(I'm a bit late but I don't care)

acoustic wharf
#

How do you build one

stoic vector
acoustic wharf
#

What website do you go on

stoic vector
uneven knot
#

hello, do you have 16x16 templates?

#

I only have templates from 1x1 to 8x8, I'm missing the rest, does anyone have them?

pastel tulip
#

Messy but it's 16x16

uneven knot
uneven knot
#

Psorry i forgot the translator why this error

#

Taba doing night animation test plugin

#

I do not know what it is "null"

smoky glacier
uneven knot
south garnet
potent jolt
#

also thats not the right location to be putting your stuff

stoic vector
#

i think the name should be changed to 'plugin-lua-support' or something similar

potent jolt
#

well technically the channel is also for FUN scripting

#

for the 3 poeple that have ever used it

#

poeple just have the misconception that json = scripting

uneven knot
#

Ok

stoic vector
#

bruh

north aurora
#

SimCity?

uneven knot
#

You are already an architect πŸ‘Œ

stoic vector
#

oh god no

uneven knot
#

Ono va and pasar otra vez

#

did not translate it well

cerulean crypt
#

F we are in wrong channel

uneven knot
#

Hey, I could put nocturnal animations but. the puglin has two images for you to rotate or flip with the arrows but by adding the night animation to the first image it can no longer be rotated

#

How do I make a plugin with night animation but still rotate??

#

rotate with the arrows not with the camera

cerulean crypt
#

"frame":0
"frame":1
"frame":2
"frame":3

stoic vector
#

:0

uneven knot
#

sorry leave hello tr

#

animation ids always go up vrd

cerulean crypt
potent jolt
#

if youre planning on lua scripting, visual studio code

uneven knot
# cerulean crypt

Oye te puedo pasar el puglin y me puedes decir que tengo que ASER para crear un puglin que rote no que jite ala cata sino que sea de elaso que tienen flechitas se aseelos pero no con animaciones nocturnas y ya no se quΓ© ASER me ayudas

πŸ‡ΊπŸ‡²
Hey, I can pass you the plugin and you can tell me that I have to ASER to create a puglin that rotates, not that jites wing tasting, but that it's made of elaso that has little arrows, it cleans itself but not with nocturnal animations.

uncut field
south garnet
torpid spear
#

a lot of other alternatives, vsc is best though

uncut field
#

Notepad++ works fine too

#

Anything that can edit text should work though

#

Visual studio code has a lot of convenient features, but it might be a little intimidating at first

zinc isle
#

Use #plugin-discussion or #plugin-support to ask for help regarding json issues. This channel is used for lua, a speecial coding language very few people know how to use.

civic ether
#

is it not necessary to animate road deco?

#

planning to make a scrap yard

#

oh wait it is

zinc isle
umbral canopy
#

hi

cerulean crypt
#

It is possible to run other code by changing game language?

#

Disabling and enabling, scrip or json by just changing language

weak mural
#

yes, it's possible.

trim remnant
#

Next time I request we use a channel that's not this one

potent jolt
#

cancelled industri

golden agate
#

Ok

#

I'm learning document about Lua

#

It's cool

golden agate
#

How can I change frame

#

All I found is

#

setFrameType()

#

And

#

drawTileImage()

potent jolt
#

you can set the animation frame

#

as well as an upgrade, if you dont need to switch often

golden agate
#

Okay

potent jolt
#

now that i think about it, is there a way to have a building unlock requirement controlled by lua

#

though i suppose you could use a fun variable set by lua

torpid spear
#

pretty sure that's how dsa handles it

#

would you like some dsa source code

potent jolt
torpid spear
#

the infamous 10 mb rocket animation text file

potent jolt
#

a classic

light plinth
torpid spear
wary pewter
#

Oh, are you challenging him?

#

I wouldn't if I were in your place

rare grottoBOT
#
Case #3169

LorenaMelo#9096 was banned for the following reason: Sharing scams or phishing content.

potent jolt
#

person posts nitro scam -> gets banned -> channel remains unread

zinc isle
#

pretty much

zinc isle
umbral canopy
#

I need a plane code please

#

I want to design an airplane, I need help

zinc isle
cloud agate
#

Is there scripting in vehicles?

potent jolt
#

if you know lua, theres some available

#

actual control of the vehichle itself is still handled by the game though

cloud agate
#

Ok so I want to make a fire station which has helicopters

#

How to do that?

potent jolt
#

its theoretically possible but i think that is beyond your level of experience

#

and it would be quite a lot of work

#

since the game does not have anything to help with that

stoic vector
#

Is there anyway I could program the planes to have controls?

cloud agate
#

Easy..

#

Maybe

potent jolt
cloud agate
potent jolt
#

for doing things that plugins usually dont support

cloud agate
#

Then lua script is used for what in theotown?

torpid spear
#

please refer to the tutorials/lua api

#

lua has a large library of functions and their uses are pretty much infinite

potent jolt
#

lua can do almost everything, but its not something you can just hop into

cloud agate
#

I know the powers of lua but don't know in theotown about it

#

Ok to the tutorials now

potent jolt
#

theotown has no helicopter related lua apis

#

youd have to draw and move it yourself

#

but its better to just lift the helicopter spawner from the in game building

cloud agate
#

How do I do that now?

potent jolt
#

theres at least 1 post on the forum that says how to do it

#

the games json for the fire hq helicopter is not available since it is an in game purchase

#

but you can just go off a generic helicopter building

torpid spear
#

or copy swat hq json, if it's not hardcoded

#

it shouldn't beℒ️

torpid spear
#

I'm not aware of the limitations

#

refer to the helicopter tutorial, as you've been told multiple times already

rare grottoBOT
#
Case #3211

NaonWeh#7650 was banned for the following reason: Sharing scams or phishing content.

potent jolt
#

my day be so fine

stoic vector
#

hi i need help how to use a link by lua? i want to make a guy pressing button and he will be sended to link

potent jolt
#

thats a restricted functionality

#

youll have to ask lobby or ja for that

stoic vector
#

oh

#

then ill just make them copying the link

#

i guess that spendDiamonds (amount) is too not for everyone cuz its not working to me

potent jolt
#

it states that it requires privilege

#

youll need to request it

stoic vector
#

i dont rly need it just asked

elfin geyser
#

What is lua

torpid spear
#

please stop misusing this channel

stoic vector
#

spendDiamonds (getDiamonds ())

light plinth
#

A fine way to get suspended for life

#

Ask any Jeremiah

uncut field
#

Nah, that's just new game+

atomic panther
#

Is there a simple code generator here?

potent jolt
#

nope

#

lua cant be generated

#

but if you mean json

chilly burrow
#

Design is more difficult than coding

zinc isle
potent jolt
#

#plugin-lua-fun when

stoic vector
#

how to call plugin store?

potent jolt
#

what are you talking about

stoic vector
#

i want to code shortcut to plugins for pc, like on mobile

#

i coded button but idk how to make it call store on click

#

what i should use? openStore(), or something like this?

#

maybe call an in-game function

potent jolt
#

i dont think this is currently possible

#

you'd need to change the game's stage

#

(stage is settings, city, pluginstore, etc)

#

you cant really forcibly navigate the user to it

#

unless you were to find the correct gui buttons and press them for the user

stoic vector
#

dont think its a right one

torpid spear
#

ah yes

stoic vector
#

at least it know onClick

#

lmao it used " " instead of ' '

stoic vector
torpid spear
stoic vector
#

idk in tutorials always '

torpid spear
#

ok

stoic vector
#

k ill try this code but remade

#

dont think there is module 'game'

#

anw modules always start with capital letter

torpid spear
#

ai won't generate usable code

#

I'm pretty sure about that

#

that's not how any of it works, I'm not sure if you can ever open the plugin store with a plugin

zinc isle
torpid spear
#

definitely gonna work, trust me

potent jolt
#

also chatgpt is trained on the 2019 internet

#

it wouldnt know the lua api exists

stoic vector
#

is there any in game functions list

torpid spear
#

what do you mean 'functions'?

#

attributes?

#

the lua api?

potent jolt
stoic vector
#

ghost ping

potent jolt
#

you need to put "draw ground": true on your json

stoic vector
#

this channel is for fun and lua

potent jolt
#

you can say it 50 million times but the next guy is still gonna come in here with his json question

stoic vector
#

ok

potent jolt
tame dock
merry holly
trim remnant
#

That's not scripting

stoic vector
#

json is bunch of data

uncut field
flint timber
#

and how to find out on the phone where in the figure x and where V

stoic vector
#

what id does information dialog of building have? like sidebar is GUI.get('sidebar'), what id does information dialog have?

#

ye ik there's Script:finishInformationDialog, so we can guess that its informationDialog, but idk, it didnt work

potent jolt
#

what are you going to use it for

#

if you want a custom dialog entirely i can point you to script:click

#

which wont create a dialog if you return false

#

so you can make your own

stoic vector
#

oh

#

thanks so much

stoic vector
#

ok but then how to access to list with updates?

#

i just want to have values of variables in information of building

#

ok nvm i can use Building:setText

latent ginkgo
torpid spear
#

that's not scripting

#

it should be "needs land" and "needs water"

void wolf
#

im afraid we do not understand the translation

south garnet
#

Please, learn how to write properly without orthographic issues before translating

uneven knot
#

I hope it translates better, otherwise I delete it and improve it, okay

It has been a while since I accidentally found a plugin that contained nocturnal animation in it so that when it got dark I put the lights or textures at night but Alava removed the building And only the luses were left, there were floating around, I don't know how I did it, I forgot, I hope someone knows how to do that, I also lost the puglin when I deleted everything by accident: (

If it's wrong don't report me. Just tell me and I'll delete it please excuse me

torpid spear
#

I assume there's something wrong with your night animations but the rest is completely incomprehensible

#

I also doubt it is related to scripting in any way but I don't care anymore

torpid spear
#

this is not scripting so use the correct channels

#

also nobody knows what the problem is

dapper zenith
#

havre is french not soviet

crisp acorn
#

Remastered version typical sovet residential- soon

smoky glacier
#
  1. This isnt the right place for this
  2. its no longer available
jade mist
#

Thank you for telling me and aight

potent jolt
#

you know this is just gonna keep happening

#

unless the channel is renamed or smth

zinc isle
#

"lua and fun"

trim remnant
random hamlet
#

(oldpost again but just saw this) I disagree

#

that channel is especially for support

#

and this one is for fun/lua (obv)

#

so it's different

#

theres kinda an overlap but I still think it should be separate because of scripting related discussions

#

however I have a suggestion to make, gonna make it

trim remnant
#

We will see what that helps

torpid spear
#

we do a little experimentation

mild thistle
#

I imagine at least 1 person will still post about Json

noble hedge
#

ah yes, I can now ask fun attr questions here

soft salmon
#

what is this?

mild thistle
soft salmon
#

Ohhhhh okey okey

mild thistle
#

Used to be #plugin-scripting, but too many people posted Json instead of Lua

potent jolt
#

cheers

#

no more json questions

visual dirge
#

plugin json and fun

light plinth
#

||fun is json||

potent jolt
#

(its me)

light plinth
potent jolt
#

alright

#

what fun questions do you have

random hamlet
#

nice

light plinth
potent jolt
#

step 1 is to write a letter to them

#

step 2 is to bully justanyone to implement it natively

zinc isle
mild thistle
#

Yeah, because no one seems to care for topics

zinc isle
random hamlet
#

wow this channel become active for a day

#

later it'll still be inactive but at least (hopefully) only used correctly

#

if only there were more coders

#

wait, actually... I think it'd be cool to add shader discussion in the topics

#

(it wouldnt change anything cuz all shaders except 2 are made by me for now lol...)

random hamlet
#

super rare screenshot

#

it looks like the focus is on messages

wary pewter
#

plugin lua and fun

gentle canopy
wary pewter
digital kindle
#

Would ask if using table for json would work?

local character = {
    "Yakka",
    "Anonymous"
}

local text = {
    "Hello world!",
    "Makes Sense...",
    "Who asked?"
}

local append = {}
-- Sets the array that will be used in the notification
for i = 1, #character do
    for j = 1, #text do
        for k = 0, 3 do
            table.insert(append, '{"id": "$YKPS'..k..'", "type": "topic", "color": { "r": 255, "g": 255, "b": 255 }, "text": "'..character[i]..' : '..text[j]..'"}')
        end
    end
end

local json = '['..table.concat(append, ',\n')..']'

Draft.append(json)
potent jolt
#

you can use Runtime.toJson

twilit thorn
#

Is this same Lua as Roblox?

#

I thought we do JavaScript

noble hedge
#

we're using both

light plinth
#

no

potent jolt
#

thats not how any of this works

noble hedge
#

Is it possible to implement this thing using fun? I wanna detect road usage in x y (that is, somewhere nearby) relative to my road deco position?

#

Then change it to another road deco depending on the road usage

potent jolt
#

ought to be possible with lua, but idk much about fun

hallow geyser
#

wait u can make plugins with Lua?

torpid spear
#

lua is a scripting language

#

you can add more functionality to your plugins with it

noble hedge
#

Is it possible to add background sounds when I zoomed in on an object? using lua or fun?

#

A sample, is much appreciated

potent jolt
#

you can use City.playSound for this

#

but you would also need to keep track of all your buildings

#

is it possible to build multiple of your building?

light plinth
zinc isle
#

best naming ive ever seen

potent jolt
#

possibly broken, contains legacy code

#

theres better solutions for a couple of the parts of it

noble hedge
potent jolt
#

still possible, just a little more involved

#

but i would not do it if there are many of your building that might be built

#

like an rci

noble hedge
#

I'm attempting on a roaddeco

noble hedge
#

Is it possible to add script to override cars behavior? Car will NOT despawn until it reaches its destination (say, car is in traffic jam) unless the road from bldg A to bldg B has no connection (despawn)

potent jolt
#

you can get the car's location

light plinth
#

fps plugin malware

potent jolt
#

it works?

#

doesnt on my machine

noble hedge
#

the sound works well on my android

potent jolt
#

perhaps i simply have a broken version

#

either way, it does contain code that is outdated

#

so bear that in mind

noble hedge
light plinth
#
    bx, by = City.getBuilding(1, buildingDraft)

    if song then
      song.setPosition(bx, by)
    end
  end```

The following only plays the song for the first building in the list
potent jolt
#

youll need to do some work to adapt it to multiple buildings

#

but it is possible

frigid sparrow
hollow parcel
noble hedge
#

Do we have City.countRoadDecos([draft]) and .getRoadDecos() similar to
.countRoads()

plush sail
#

first is i think how many of one deco, second is gow many all decos and third is all road tiles

torpid spear
elfin geyser
#

Damn i feel like I'm newbie again, does lua support shorthand operations like a += 1

potent jolt
#

sadly not

elfin geyser
#

I'm thinking how I could add visible path on roads for my TX plugin upon selecting routes

potent jolt
#

i don't really think that's feasible unless we get some way to get a car's route

noble hedge
#

What if the path keeps changing?

elfin geyser
#

Yup that's what im thinking since TX bases its "reachable" or "unreachable" state if the test car spawn to reach specific target. I'm thinking of making a 999 speed test car to collect all tiles that car used on its path however its seems unguaranteed due to uncontrollable how system use to calculate path for i-car

elfin geyser
noble hedge
#

I wonder if the changing path is proportional to changing reachable/unreachable state, im thinking to my traffic lights

elfin geyser
#

You're relating my TX on your traffic lights?

noble hedge
#

Im guessing if all roaddecos or roads affect the behavior of the road, does it affect the path?

#

say, we can control the dirs:[] of the road, indefinetly

#

does it change all current paths available?

elfin geyser
#

No it's not the car will just disappeared from a long 0 speed made by road decos

noble hedge
#

yeah, a pre-calculated thing

elfin geyser
#

About modifiying dirs[] it might

#

What if we put 0.0000001 on a road deco, do car will disappear by being on it for a long time?

noble hedge
#

interesting

#

I tried 0.1 but it does nothing

#

gonna try that

elfin geyser
#

Maybe i should just rely my path by adding visible station index number upon picking

potent jolt
potent jolt
noble hedge
#

then if the car is running on the path that have a road changing behavior (say, the direction of the road changes to opposite directions), the car despawn instantly on that road

potent jolt
#

yea

#

you can test it yourself

#

if you demolish a road the cars will drive into it and vanish

light plinth
potent jolt
light plinth
#

in what format

potent jolt
#

an array of coordinates of corners/intersections i suppose

#

kinda depends on the way that data is stored in the game

potent jolt
#

that would allow visualisation of the car's route, and perhaps some extra shenanigans

elfin geyser
#

I really forgot how to fix this

#

Need some refresh out here

potent jolt
#

use setTile to set the exact pixel youre gonna draw on and pass 0,0 to the x and y in drawText

#

that way it will be in the same location

#

(just dont forget to handle city rotation like i always do)

elfin geyser
#

Got it thanks

wraith garden
#

Could anyone tell me if there is any code to remove the bridge pier?

noble hedge
#

I don't think so

noble hedge
#

Schrodinger traffic lights

#

They do stop and don't

hollow parcel
#

I dont know how to print random strings so I did this. will this work?

torpid spear
#

you should probably put your strings in a table and randomize that

hollow parcel
#

idk how to randomize strings.

#

i only know numbers

torpid spear
#
local t = {'x', 'y', 'z', ...}
print(t[math.random(#t)])```
hollow parcel
#

thanks.

torpid spear
#

society if lua didn't index from 1

potent jolt
#

krill issue

#

by the by, your script will not print anything if the random number is 3

native timber
#

how does spendCurrency differ from spendMoney?

potent jolt
#

spendcurrency can spend other types of currency

native timber
torpid spear
#

pretty sure those are also created by the user

native timber
#

got it, what's the name of the regular currency?

torpid spear
#

there's earnMoney and the like for default theons

native timber
#

I don't understand what bugdetitem means

torpid spear
#

why would you need that

#

budget item refers to a line in the budget overview tab

torpid spear
#

I can't make it any clearer

native timber
#

a screenshot?

torpid spear
potent jolt
#

just click your money

native timber
#

And how do I specify this string? Like, what values can it take?

torpid spear
#

do some research on the forums

#

pretty sure the json content page contains the ids

native timber
#

What do the x and y mean? I thought I knew, but I don't.

torpid spear
#

..coordinates?

#

it can either refer to screen or map coordinates, but I don't know which specific function you're talking about

native timber
#

im very noob bruh

torpid spear
#

any more questions?

native timber
#

It's my creation, and it's wrong about 101% of the time, but I don't understand what exactly it's wrong about (other than earnMoney lol)

torpid spear
#

oof that's painful to look at

#

function names are case sensitive I'm pretty sure

potent jolt
#

you should pick better variable names

#

also yes

#

getincome is incorrect

torpid spear
potent jolt
#

outplayed

#

also, you use your buildingDraft before you even get it

torpid spear
#

wtf are those colors

#

did your vsc have hiccups?

potent jolt
#

whatever it is, its not a lua language server

native timber
#

Honestly, I have no idea how to customize VSC for lua, I searched on the internet, but it's a load of crap, I have to write by feel.

native timber
torpid spear
#

as I said it's case sensitive

torpid spear
native timber
torpid spear
#

bottom right corner

native timber
potent jolt
#

you probably installed multiple lua plugins

torpid spear
#

you know you can click around on yor computer

#

also yes, I'm not asking whatever you've done to your vsc

native timber
#

I have no idea how to build a VSC under lua.

potent jolt
#

you only need the lua language server by sumneko

#

you probably installed way more than that

native timber
#

?

#

what i need to fix now

#

earnMoney?

torpid spear
#

fix your spaces and indentiation

native timber
torpid spear
#

you ain't going anywhere with those indents

#

indent all your bodies of functions, loops and if statements

native timber
#

cant find budgetitem

torpid spear
#

you just added some new lines here and there

#

nothing indentiation wise

#

there's also a spare space in your function definition

#

aand that's not how you'd pass a boolean in the earnMoney function

native timber
#

I'm a noob, I have no idea how to structure it

torpid spear
#

it might be a wise idea to learn basic lua structure first

native timber
#

still wrong

torpid spear
#

because that's not how you do it....

#

read some beginner lua docs

#

you pass a boolean the same way as any other type (all the other ones are fine)

native timber
torpid spear
#

what does compilation have to do with any of this

#

you don't compile lua files for theotown

native timber
#

i know

torpid spear
#

also, if your docs don't say anything about structure you're looking at the wrong docs

native timber
#

But you're talking about training, how do I train without compiling?

torpid spear
#

??????????????????????????

native timber
#

bruh

#

ok

torpid spear
#

I have 0 idea what you're even talking about

native timber
#

can you just say how to fix it, to understand how it works, I basically decided to try to write such a script to understand about working with lua in theotown, I'm trying to find information about lua programming inside theotown, but all I can find is this site https://doc.theotown.com/modules.

#

I'm looking for lua training, but it means learning lua in general as a programming language, not a word about private modules like programming in theotown, it doesn't help me much.