Hi,
i used Player:SetPosition() with HOOK_PLAYER_SPAWED Event.
But if the player died in WorldX and i used with spawn the Player:SetPosition() command then
spawn the player in DefaultWorld and not in WorldX. Why? I used "return true" after Player:SetPosition().
i used Player:SetPosition() with HOOK_PLAYER_SPAWED Event.
But if the player died in WorldX and i used with spawn the Player:SetPosition() command then
spawn the player in DefaultWorld and not in WorldX. Why? I used "return true" after Player:SetPosition().
function PlayerSpawned(Player) local PlayersUUID = Player:GetUUID() local PlayersCurrentWorld = Player:GetWorld() local CurrentWorldSettings = WorldBedSetting:getWorldSet(PlayersCurrentWorld) print("CurrentWorldSettings:", PlayersCurrentWorld:GetName(), CurrentWorldSettings) local SpawnWorld = cRoot:Get():GetWorld(CurrentWorldSettings.SpawnWorld) local SpawnWorldSettings = WorldBedSetting:getWorldSet(SpawnWorld) if (CurrentWorldSettings.BedAllow and PlayersPositions:IsBedActive(Player, PlayersCurrentWorld)) then print("Bed CurrentWorld: Bed erlaubt & Bed Existiert") -- if bed esist in this world > Port To Bed local BedPos = PlayersPositions:GetBed(Player, PlayersCurrentWorld) print("Bedposition in :" .. PlayersCurrentWorld:GetName(),BedPos.BedPosX, BedPos.BedPosY, BedPos.BedPosZ) Player:SetPosition(BedPos.BedPosX, BedPos.BedPosY, BedPos.BedPosZ) return true elseif (SpawnWorldSettings.BedAllow and PlayersPositions:IsBedActive(Player, SpawnWorld)) then print("Bed SpawnWorld: Bed erlaubt & Bed Existiert") -- if bed exist in SpawnWorld > Port to Bed in SpawnWorld local BedPos = PlayersPositions:GetBed(Player, SpawnWorld) local spawnpos3d = Vector3d(BedPos.BedPosX, BedPos.BedPosY, BedPos.BedPosZ) Player:ScheduleMoveToWorld(SpawnWorld,spawnpos3d,false) return true else -- whats spawn method in SpawnWorld if (SpawnWorldSettings.RandomSpawn == true) then print("RandomSpawn") PortToRandomPos(Player,SpawnWorld,PlayersCurrentWorld) return true else print("MapSpawn") PortToMapSpawn(Player, SpawnWorld, PlayersCurrentWorld) return true end end return true end