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.
Player = game.Players.LocalPlayer --Only works inside a localscript, replace with the line below it if you need it as a Script.
-- Player=script.Parent while (not Player:IsA("Player")) do Player = Player.Parent end
script.Parent.MouseButton1Up:connect(function()
local index, Time
for index, Time in pairs(Player.leaderstats:GetChildren()) do
Time.Value = 0
local db = true
local player = game.Players.LocalPlayer
local target = game.Workspace.TeleportPart
local delay = 3
script.Parent.MouseButton1Click:connect(function()
if db == true then
db = false
player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)
for i = delay, 1, -1 do
script.Parent.Text = i
wait(1)
end
script.Parent.Text = "Reset"
db = true
end
end)
end
end)
Any sort of help will be appricieated

4 comments
k thanks i will try that
Thanks it worked
i am still stumped that it worked without me putting model name in it and now it didnt.
np