English F2 to tile?

7 replies
Goto Page
To the start Previous 1 Next To the start
05.07.15 02:20:56 am
Up
Goo
User
Offline Off
I downloaded a script but I already have another script working on F2,F3,F4 so I wanted to make it start the menu when I step on a tile

Script: http://unrealsoftware.de/files_show.php?file=9757
I'm not good at lua so dont blame me
edited 1×, last 05.07.15 05:10:14 am
05.07.15 02:44:44 am
Up
Rainoth
Moderator
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
menus = {
[1] = {x = 88, y = 99, str = "Title,button 1,button 2"},
[2] = {x = 89, y = 98, str = "Title B,button 1,button 2"}
}

addhook("movetile","yey")
function yey(id,x,y)
     for k,v in pairs (menus) do
          if x == v.x and y == v.y then
               menu(id,v.str)
          end
     end
end


x and y are positions of your tiles and str is the menu string. all you have to do is copy the string that would call the menus you want and place it in the table.
05.07.15 03:15:21 am
Up
Goo
User
Offline Off
@user Rainoth: I'm sitting here for about 5 minutes and I cant understand what to do.

Script:
More >
05.07.15 12:44:16 pm
Up
Rainoth
Moderator
Offline Off
That code shouldn't even work. I've started tabbing it and there's missing ends >.>
You could begin by tabbing your code to make it readable. Trust me, it pisses off everyone if they have to read untabbed code and they normally just have to tab it themselves. So you're not helping out others just by posting such code. Secondly, you could use code tags in this forum, they also help.
Give me a sec and I'll fix your script then explain some more and then give you what you need.

// Here's your tabbed
code >

I also removed all the needless "if end if end if end" crap and changed it to "if elseif elseif elseif end"

/// I added the feature you wanted in the following
code >


//// and finally it's been a while since I've worked on lua so I thought I'd give it a go. Try if the script works fine with this
code >


Hope that helps. In the future please tab your code.
edited 4×, last 05.07.15 01:41:58 pm
05.07.15 07:45:33 pm
Up
Goo
User
Offline Off
parsing Lua autorun script 'sys/lua/autorun/Shop.LUA'
I think its working...
Where to put the X/Y? I tried this line:
[1] = {x = 123, y = 123...
But it did nothing

The file is on autorun...
05.07.15 08:35:54 pm
Up
Rainoth
Moderator
Offline Off
Ooops! I missed two commas in between tables that's why it shouldn't have worked. I added them now in this
code >

I tested it and it did display a menu for me.
05.07.15 11:44:55 pm
Up
Goo
User
Offline Off
@user Rainoth: Thanks! It worked! Now my server will be 0.000000000001% more popular! Hurray!
06.07.15 03:23:12 am
Up
FaceBook
BANNED
Offline Off
hi :user Goo
you need script ?
one of you pro's thousand multi accs
To the start Previous 1 Next To the start