Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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

Log in to vote
-1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

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!

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. M39a9am3R 3210 — 10y
0
Wait, remove the line for starter gear I think that's the problem (along with the sub stuff). M39a9am3R 3210 — 10y
0
I thought StarterGear would be fine, but you could be right. Perci1 4988 — 10y
0
What do i remove besides the starter gear stuff? Alpha_Toon 57 — 10y
View all comments (2 more)
0
Why the heck was this downvoted? Perci1 4988 — 10y
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... Perci1 4988 — 10y
Ad

Answer this question