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

Teleport Part is not a valid member of workspace ?

Asked by 6 years ago

I have a Part named "Teleport Part" in my workspace. The reason for that part is to teleport to it when i press a button. But when i press the button it says Teleport Part is not a valid member of workspace. My part is in a model.

Just ignore the comments since i took this script from somewhere else but put my info in it. It used to work before but suddenly stopped.

01Player = game.Players.LocalPlayer --Only works inside a localscript, replace with the line below it if you need it as a Script.
02    -- Player=script.Parent while (not Player:IsA("Player")) do Player = Player.Parent end
03 
04    script.Parent.MouseButton1Up:connect(function()
05        local index, Time
06        for index, Time in pairs(Player.leaderstats:GetChildren()) do
07            Time.Value = 0
08local db = true
09local player = game.Players.LocalPlayer
10local target = game.Workspace.TeleportPart
11local delay = 3
12script.Parent.MouseButton1Click:connect(function()
13    if db == true then
14        db = false
15        player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)
View all 25 lines...

Any sort of help will be appricieated

1 answer

Log in to vote
0
Answered by
stepatron 103
6 years ago

If the part is in a model, you have to put that too. so it should be:

1local target = script.Parent.ModelName.TeleportPart
0
k thanks i will try that stuntbros -3 — 6y
0
Thanks it worked stuntbros -3 — 6y
0
i am still stumped that it worked without me putting model name in it and now it didnt. stuntbros -3 — 6y
0
np stepatron 103 — 6y
Ad

Answer this question