I have made the following script, it needs to teleport the player from one world to another, however, it does not work. This script is a localscript. The reason for all of the different things is that the parts lie inside a model, named DannebrogStill.
local TeleportService = game:GetService("TeleportService")
local placeID_1 = 751068488
local player = game.Players.LocalPlayer
while true do
game.Workspace.DannebrogStill.End.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.Head.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.Middle.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.NearMiddle.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.Second.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.Third.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
game.Workspace.DannebrogStill.Torso.Touched:Connect(function(part)
if part.Parent.HumanoidPlayer then
TeleportService:Teleport(placeID_1, player)
end
end)
end

5 comments
What doesn't work? Does it give an error or anything?
Can you post a screenshot of the parts?
can you reply with the output?
ye that to
thats for a localscript use something like game.Players:GetPlayerFromCharacter(part.Parent.HumanoidPlayer) but you should also define the HumanoidPlayer