

If Leaderstats.inventory:WaitForChild(NewCharacter.Name).Value then NewCharacter = Button.Parent:FindFirstChildOfClass("Model") Local Leaderstats = Player:WaitForChild("leaderstats").avatarsįor _, Button in pairs (script.Parent:GetDescendants()) do Local Player = game:GetService("Players").LocalPlayer Local Camera = game:GetService("Workspace").CurrentCamera Local Module = require(RS.NotificationModule) Local RS = game:GetService("ReplicatedStorage") Avatar Loading Event Ordering ImprovementsĬlient-Side local Debris = game:GetService("Debris")

RespawnEvent.OnServerEvent:Connect(respawnPlayer) NewModel.Parent = workspace - this follows current character loading behavior Local oldCFrame = oldModel:GetPrimaryPartCFrame() Local model = replicatedstorage.Characters:FindFirstChild(modelName) I would believe it to be like so: local function respawnPlayer(plr, modelName) You should be able to just set player.Character directly on the server without having to use :LoadCharacter, but I am rather unfamiliar with the mechanics of loading a character through setting a property like this. The default control and camera scripts are not dependent on character changes like this, I would only be potentially worried about network ownership. On your server-side, I think you are making a misconception of what player.Character and player:LoadCharacter are supposed to do.Character gives you the current character, and :LoadCharacter only respawns the character, nothing else is done. Local model = location:FindFirstChildWhichIsA("Model")Īssert(model, "model does not exist for this location!") On your client side, you can use :FindFirstChildWhichIsA to get your model: selectButton.MouseButton1Click:Connect(function()
