Hi.
Im creating a give-script. I get the player name from a command:
local ciplr = string.sub(msg, 10, -4)
Now if i try to clone an object into the Inventory of the player, it says:
OKRPLAY is not a valid Member of Players
im using this code:
local ticket = game.ServerStorage.FirstClass:Clone() ticket.Parent = game.Players[ciplr].Backpack
Is it possible to convert the string to a player object?
A couple things, if they type the name wrong it will break the code caps and everything, and I'm pretty sure you did the substringing wrong where it should be like:
local ciplr = string.sub(msg, 4)
if you want to get rid of the first 4 characters in the string it should be ^
What you're doing should technically work if you have the right string from string.sub but I don't think its substringing right