I Have problem with Teleport
The Teleport button won't teleport the character back to spawn after i died to a laser or after i reset character and it says "TpBackToSpawn is not a valid member of Workspace "Workspace"
Here's the script :
local button = script.Parent
local spawnPoint = game.Workspace.TpBackToSpawn
local function onButtonClick()
if spawnPoint then
local character = game.Players.LocalPlayer.Character
if character then
character:SetPrimaryPartCFrame(spawnPoint.CFrame)
end
else
print("Spawn point not found!")
end
end
button.MouseButton1Click:Connect(onButtonClick)