So I have a game rn. And I have a lobby'ish place and I want it so that if the player clicks the block, then it'll teleport the player to a new part of the map. (Oh and I don't even know if the instance.new code is working.)
local firstSpawnFolder = game.workspace.FirstSpawnFolder
local clickForSpawnPart = firstSpawnFolder.ClickForSpawnPart
local clickDetector = clickForSpawnPart.ClickDetector
clickDetector.MouseClick:Connect(function(hit)
SamuraiSpawn = Instance.new("SpawnLocation",game.workspace)
SpawnLocation.Position = (237.4,2.1,-176.5)
SpawnLocation.Orientation = (0,110,0)
game.workspace.Players.LocalPlayer("Humanoid").Position = Vector3.new(237.4,2.1,-176.5)
end)

1 comment
Ok so this pops up in the output when I click the part with @Kymaraaa 's script - Workspace.FirstSpawnFolder.ClickForSpawnPart.Script:8: attempt to index field 'LocalPlayer' (a nil value)