|
| 29 Jun 2016 05:29 PM |
I'm making a custom admin script for my admin house, and I was wondering
This is hard to explain, but, how do you make it so, for example..
lets say someone says |gear tor 88885539.
Of course, I wont know what the gear code is and who the player is. How do i use make the script find the player name, without knowing how long the string is? Same for the gear code. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jun 2016 06:32 PM |
| Im not good at scripting but i made a simple one by going into roblox studio, opening a well known admin command and modifying the script a little and commands. |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 06:59 PM |
@Lucky Thanks for the suggestion and thanks for replying, but the only open source admin I can find (That happens when the player chats) is Kohlstastrophe admin (Which i think is the first admin, actually..I dont know yet though.) and its crowding the stuff I need with links to functions. Its just chaos. Thanks for replying that though c; |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 07:13 PM |
funny you bring that up because my command script has a command just like that
you need to use the marketplace service to verify the asset exists then verify its asset type then insert it. |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 07:54 PM |
@Speedy I already have the tool in serverstorage. I need it where it actually gives it to the player specified. |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 07:56 PM |
@Speedy I need the part where it gives it to the player specified though.... |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jun 2016 07:56 PM |
@Speedy By the way, ignore that first reply. My internet just pooped :l |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 07:58 PM |
@Speed How would I track the speaker? Like, in the example, I want it so it gives it to the player specified. Example..
|gear david 88885539
this gives a player named david the gear with an id of 88885539 |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 07:58 PM |
game.Players.PlayerAdded:connect(function(pl) pl.Chatted:connect(function(msg) -- the speaker is "pl" end) end) |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 08:00 PM |
Well since your delimiter is a space, you can split the string by spaces:
local function split(str) local phrases = { } for phrase in str:gmatch("%S+") do phrases[#phrases + 1] = phrase end reutrn phrases end
So then you can do: local command = split("gear tor 88885539") print("Player name: " .. command[2]) print("Gear ID: " .. command[3]) |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 08:18 PM |
i know you can use spaces :( But I don't like doing that.
I dont know why maybe its a preference thing but when you build a command script around space mechanics it makes making longer commands infinitely more difficult IMO. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jun 2016 08:34 PM |
| Well, doesnt work for my code anyway |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 08:39 PM |
| k just realised its something with InsertService, either that or parenting it to the player's backpack. |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 29 Jun 2016 08:42 PM |
Here's a tip if you say something that works 'doesn't work', people are most likely not to reply to you lol.
1. Because it's kind of rude. 2. Because it's not enough information to fix the problem.
Good day.
|
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 08:45 PM |
It's not enough information but mini modding doesn't improve your chances at being taken seriously.
Flux, you didn't include enough information as to what exactly he should do with said code you posted. Even I noticed it. |
|
|
| Report Abuse |
|
|
Lem0nzzx
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
|
| 29 Jun 2016 08:50 PM |
I wasn't really laying any rules out, I was just telling him that he's not giving out enough information, and gave him a few tips to fix the issues. You might need to rephrase that into something else you'd like to start an argument over.
|
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 08:56 PM |
@Lem0n Did you not see the thing i posted after it.
"I just figured out that it was something with loadasset or the player's backpack"
might not be word to word but you get the point. pls dont murder me |
|
|
| Report Abuse |
|
|
|
| 29 Jun 2016 09:33 PM |
| The only thing I answered was what the OP asked "I wont know what the gear code is and who the player is. How do i use make the script find the player name, without knowing how long the string is? Same for the gear code." in a general and expandable way. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 06:27 AM |
Welp, fixed the problem. Turns out that when you insert gears through insert service it puts it in a model (For some reason...) thus making it not show in the backpack. Thanks for the help guys, and especially flux.
I also forgot to mention I was raging for the past 3 |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2016 06:28 AM |
@tornado Raging for the last 3 hours. Lel |
|
|
| Report Abuse |
|
|