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

How do you find the client's character in a server script?

Asked by
CL4VIN 9
4 years ago

I'm trying to make a "jojo-ish" game where you have a ghost/stand that lots behind you, except it's your avatar. Is there a way to find and clone a character with a server script?

half the script is making the limbs in the same location as your character

I know I'm doing this wrong so maybe could someone help steer me in the right direction?

Script:

01game.ReplicatedStorage.GiveStand.OnServerEvent:Connect(function(player)
02local playerStand = player.Character:Clone()
03    while true do
04        playerStand:WaitForChild("Left Arm").Postition = player.Character:WaitForChild("LeftArm")
05        playerStand:WaitForChild("Right Arm").Postition = player.Character:WaitForChild("Right Arm")
06        playerStand:WaitForChild("Left Leg").Postition = player.Character:WaitForChild("Left Leg")
07        playerStand:WaitForChild("Right Leg").Postition = player.Character:WaitForChild("Right Leg")
08        playerStand:WaitForChild("Head").Postition = player.Character:WaitForChild("Head")
09        playerStand:WaitForChild("Torso").Postition = player.Character:WaitForChild("Torso")
10        playerStand:WaitForChild("HumanoidRootPart").Postition = player.Character:WaitForChild("HumanoidRootPart")
11        playerStand:WaitForChild("Torso").Orentation = player.Character:WaitForChild("Torso")
12        playerStand:WaitForChild("Left Arm").Orentation = player.Character:WaitForChild("Left Arm")
13        playerStand:WaitForChild("Left Leg").Orentation = player.Character:WaitForChild("Left Leg")
14        playerStand:WaitForChild("Right Arm").Orentation = player.Character:WaitForChild("Right Arm")
15        playerStand:WaitForChild("Right Leg").Orentation = player.Character:WaitForChild("Right Leg")
16        playerStand:WaitForChild("HumanoidRootPart").Orentation = player.Character:WaitForChild("HumanoidRootPart")
17        playerStand:WaitForChild("Head").Orentation = player.Character:WaitForChild("Head")
18    end
19 end)
0
Your script is very inefficient, please use a for loop getchidren. JesseSong 3916 — 4y
0
That's not what I was asking but okay. CL4VIN 9 — 4y
0
I don't understand what you're doing in the while loop. And what is "Postition" and "Orentation"? AntiWorldliness 868 — 4y

Answer this question