Okay this may sound confusing but I will try to explain what I'm trying to do:
So what I have done is put the player's character inside of a folder called "Players" in workspace:
Keep in mind that this is in a SERVER script and I am able to get the player's name because I made a remote event. So this is inside of a function for a remote event :) (this isn't the problem)
local function FindCharacter(player) --GetCharacter-- local char = player.Character local InGameFolder = game.Workspace.Players -- Folder that holds the Player's Character char.Parent = InGameFolder -- This puts their character inside of it. end FindCharRE.OnServerEvent:Connect(FindCharacter)
NOW here is where I'm stuck at..
I don't know how to get them out. I tried clearing the folder with ClearAllChildren, but that obviously just deletes them.. How do I move their parent back to workspace?
I bet this is a pretty easy solution ,and I'm probably going to regret asking this question after hearing the solution but ykno.. I'm desperate.. :/
Hello! I'm BlackOrange and I'm gonna help you.
So, the solution is simple. First, let's think how YOU parented the character in the first place.
char.Parent = InGameFolder
Ok, from this line alone we can tell your commanding the character's parent to change to this InGameFolder
Object. So how did you locate this object?
local InGameObject = game.Workspace.Players
Ok, so you made a variable for it.
Now let's think of the goal: "Get the character back to the workspace"
Hey, the word workspace
sounds familiar. Let's take a look:
local InGameObject = game.Workspace.Players
char.Parent = InGameFolder
So the first block of code has "workspace" in it! I think you can use that! Wait I wanted to set the character back to workspace.
So:
char.Parent = game.Workspace
Hmm, this seems right...
So now test it out for yourself!
Good luck developer!
PS: Look at the other lines of code you have written, they can help you out.