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

why my player teleport script not working?

Asked by 3 years ago
Edited 3 years ago

This question has been solved by the original poster.
local Tycoons = game.Workspace.Tycoons

local function playerAdded(player)
    for i, tycn in pairs(Tycoons:GetChildren()) do
        local owner = tycn:FindFirstChild("TycoonOwner")
        if owner.value == nil then

            local playerValue = Instance.new("ObjectValue")

            playerValue.Name = "TycoonOwned"
            playerValue.Value = tycn
            playerValue.Parent = player

            owner.Value = player

            local char = player.CharacterAdded:wait()


            char.HumanoidRootPart.CFrame = CFrame.new(tycn.tele.CFrame.X, tycn.tele.CFrame.Y + 10, tycn.tele.CFrame.Z)

            break
        end
    end
end

game.Players.PlayerAdded:Connect(playerAdded)

hello, everything in this script are working fine except for line 19. I tried everything including making the CFrame X,Y and Z number values. I even tried using the SetPrimaryPartCframe function

1 answer

Log in to vote
0
Answered by 3 years ago

nvm, i got it. Im using a local script instead

Ad

Answer this question