#PlayerAdded does not trigger when player is teleported
1 messages · Page 1 of 1 (latest)
** You are now Level 3! **
teleport service
thanks
it seems like this service cant be tested in studio, how do u test if this service actually works while having access to console?
f9
Shows you the console while in roblox itself
thanks
i have a weird problem, the place that the player is being teleported to does not run the server scripts. I only have 1 script in the place:
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
print("listening")
Players.PlayerAdded:Connect(function(player)
print("welcome player!")
local jd = player:GetJoinData()
local tpd = jd.TeleportData
local name = tpd.name
print(player.Name .. " is joining world: " .. `{name}`)
end)
it does not print anything (image 1) however when i run it in studio it prints perfectly (image 2)
the script name is teleported and it is being correctly stored in the serverscriptservice
PlayerAdded does not trigger when player is teleported
this is how im teleporting my player from the main place
local TeleportService = game:GetService("TeleportService")
local WORLD_SERVER_PLACE_ID = ...-- Your extra place for world hosting
game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent").OnServerEvent:Connect(function (Player, WorldName)
print(WORLD_SERVER_PLACE_ID)
--local reservedCode = TeleportService:ReserveServer(WORLD_SERVER_PLACE_ID)
local teleportData = Instance.new("TeleportOptions")
teleportData:SetTeleportData({ name = WorldName })
print("teleporting", WorldName, teleportData.TeleportData, teleportData.name)
wait(5)
TeleportService:TeleportAsync(WORLD_SERVER_PLACE_ID, {Player}, teleportData)
end)
nvm i found the problem, i was publishing the wrong place