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

Script isn't teleporting the player, no error?

Asked by 6 years ago

workspace script :P Works fine in studio, not in real servers, don't really see the problem rip

print('running1')

local posPart = workspace:WaitForChild("posPart")
print('running2')

game.Players.PlayerAdded:connect(function(plr)
    wait(3)
    print('anchoring')
    local char = plr.Character or plr.CharacterAdded:wait()

    local charModel = Instance.new('Model',workspace)   

    for index, charPart in pairs(char:GetChildren()) do
        if charPart.Name == 'HumanoidRootPart' then
            print('teleporting')
                charPart.CFrame = posPart.CFrame
        end
        if charPart:IsA('BasePart') then
            charPart.Anchored = true
        end
    end
end)
0
line 16 :P User#20388 0 — 6y
0
0
DOn't really get the error? User#20388 0 — 6y

Answer this question