Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i fix this command i added to a script?

I'm trying to add a command to a admin script i am working on but it isn't working. Not really sure what i am missing in the code.

if msg:lower():sub(1,4) == "f3x " then
local plrz = GetPlr(plr, msg:lower():sub(5))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v:findFirstChild("Backpack") then
game.Lighting["F3X Tools"]:Clone().Parent = player.Backpack
end	
end))
end
end

1 answer

Remember, :sub() counts the characters. 'f3x ' Is 4 characters, not 8 characters. f is 1, 3 is 2, x is 3, and space is 4.

I'm not experienced with coroutines, so I'll assume that's correct. I'll also assume your GetPlr function is correct.

Hope I helped!

6 comments

0

Yes, coroutines are correct. Check this out https://scriptinghelpers.org/questions/8992/why-is-my-script-not-working I broke the coroutine down a little bit, and left a wiki article, a coroutine is how they say a script that runs along side where it was created from.

0

Wait, remove the line for starter gear I think that's the problem (along with the sub stuff).

0

I thought StarterGear would be fine, but you could be right.

0

What do i remove besides the starter gear stuff?

0

Why the heck was this downvoted?

0

Oh, I see.Center edited his post so everyone thought I was an idiot. Of course no one can look at the times they were posted...

This discussion is preserved as it was. New answers, comments, and votes are closed.