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:

game.ReplicatedStorage.GiveStand.OnServerEvent:Connect(function(player)
local playerStand = player.Character:Clone()
    while true do
        playerStand:WaitForChild("Left Arm").Postition = player.Character:WaitForChild("LeftArm")
        playerStand:WaitForChild("Right Arm").Postition = player.Character:WaitForChild("Right Arm")
        playerStand:WaitForChild("Left Leg").Postition = player.Character:WaitForChild("Left Leg")
        playerStand:WaitForChild("Right Leg").Postition = player.Character:WaitForChild("Right Leg")
        playerStand:WaitForChild("Head").Postition = player.Character:WaitForChild("Head")
        playerStand:WaitForChild("Torso").Postition = player.Character:WaitForChild("Torso")
        playerStand:WaitForChild("HumanoidRootPart").Postition = player.Character:WaitForChild("HumanoidRootPart")
        playerStand:WaitForChild("Torso").Orentation = player.Character:WaitForChild("Torso")
        playerStand:WaitForChild("Left Arm").Orentation = player.Character:WaitForChild("Left Arm")
        playerStand:WaitForChild("Left Leg").Orentation = player.Character:WaitForChild("Left Leg")
        playerStand:WaitForChild("Right Arm").Orentation = player.Character:WaitForChild("Right Arm")
        playerStand:WaitForChild("Right Leg").Orentation = player.Character:WaitForChild("Right Leg")
        playerStand:WaitForChild("HumanoidRootPart").Orentation = player.Character:WaitForChild("HumanoidRootPart")
        playerStand:WaitForChild("Head").Orentation = player.Character:WaitForChild("Head")
    end
 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