Search found 12 matches

by Temgamer
Sat Jun 27, 2020 8:08
Forum: Lua Scripting
Topic: Lua chatbox
Replies: 145
Views: 6717

Re: Lua chatbox

Also, is it possible to make console command require arguments? I tried TheoTown.registerCommand("testt", function(arg)) but this seems doesn't work how I expected I don't think there are any arguments. What do you want to do? I just wanted to make a command, which would set radius and zone around ...
by Temgamer
Sat Jun 27, 2020 0:53
Forum: Lua Scripting
Topic: Lua chatbox
Replies: 145
Views: 6717

Re: Lua chatbox

Also, is it possible to make console command require arguments? I tried TheoTown.registerCommand("testt", function(arg)) but this seems doesn't work how I expected
by Temgamer
Fri Jun 26, 2020 22:49
Forum: Lua Scripting
Topic: Lua chatbox
Replies: 145
Views: 6717

Re: Lua chatbox

How to set a console command with TheoTow.registerCommand()? I've tried putting it in script:init() and it doesn't work
by Temgamer
Fri Jun 26, 2020 22:14
Forum: Lua Scripting
Topic: Lua chatbox
Replies: 145
Views: 6717

Re: Lua chatbox

May i ask? How can i build a zones with a radius of 5 from the example building (as the center of the zone radius) I've wrote sort of function for that, it requires x and y of your building, ID of zone and radius. I tested it several times with different radiuses and it works great function buildZo...
by Temgamer
Thu Jun 25, 2020 1:05
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

Re: script:click() doesn't work

Ah you're getting a little bit confused with how TheoTown uses functions. You don't put values in script:click(x, y, level) instead you put in variables like x, y, level (a variable is a word that can have a mutateable (changeable) value). The general rule would be when you declare functions (using...
by Temgamer
Wed Jun 24, 2020 21:27
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

Re: script:click() doesn't work

It might be expecting the id of a building and not coordinates. I've tried entering id of that building, also a name of it, for some reason, but it still doesn't work. That's description of click() on the Lua wiki, in parameters there is only numbers Screenshot_20200624-221554_Chrome.jpg Also, I ch...
by Temgamer
Wed Jun 24, 2020 20:19
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

Re: script:click() doesn't work

CommanderABab wrote:
Wed Jun 24, 2020 19:51
OK. What does the lua function look like? :)
It should show me a toast, when I'm tapping at something at x:10 and y:10

Code: Select all

function script:click(10,10)
  Debug.toast("click test")
end
by Temgamer
Wed Jun 24, 2020 19:35
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

Re: script:click() doesn't work

CommanderABab wrote:
Wed Jun 24, 2020 19:09
Needs [ at the start and ] at the end if that is the complete json. :)
It's a part of bigger json file, only it uses that script. Also, 6th line in .lua file is where the "script:click()" is located
by Temgamer
Wed Jun 24, 2020 18:55
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

Re: script:click() doesn't work

Yes, there is the building, which uses that script:

Code: Select all

{
"id":"$radioo2",
 "type":"decoration",
 "category":"$0xadg_cat",
 "frames":[{"bmp":"radio.png"}],
 "width":1,
 "height":1,
 "title":"lua test",
  "text":"hope this works",
  "script":"soundplay.lua"
}
by Temgamer
Wed Jun 24, 2020 16:41
Forum: Problems
Topic: [Resolved]script:click() doesn't work
Replies: 11
Views: 1462

[Resolved]script:click() doesn't work

I've been writing some simple script, which will activate, when player tap on a building on some coordinates. function script:click(10,10) Debug.toast("click test") end But when I'm trying to start the game it returns this error: Screenshot_20200624-173751_TheoTown.jpg Where is the problem? There's ...
by Temgamer
Wed Jun 24, 2020 15:22
Forum: Problems
Topic: [Possibly resolved]Fun sound clipping
Replies: 3
Views: 1117

[Possibly resolved]Fun sound clipping

So, I'm making some sort of music player using Fun attribite. Here is the code: { "id":"$hl_02_sound", "type":"sound", "file":"Half-Life02.mp3" }, { "id":"$radioo", "type":"decoration", ... "on click fun": [{ actions: [{"type":"play", "id":"$hl_02_sound"}] }] } When I press it, it starts playing mus...
by Temgamer
Mon Nov 27, 2017 19:25
Forum: Problems
Topic: ✔Categories error
Replies: 2
Views: 475

✔Categories error

When I try to add buildings to a category, I get an error as in the picture. What I do wrong? There is a code of building: [ {"id":"$radioact_storage", "type":"$temg_nuclear00", "author":"Temgamer", [ { "id":"$temg_nuclear00", "type":"category", "title":"Nuclear", "frames":[{"bmp":"nuclear.png"}] } ]

Go to advanced search