So I made a script Called "DeathHandler" In ServerScriptService and this is the code.
game.Players.PlayerAdded:Connect(function(player) print("Player Added Yay!") local Stage = player:WaitForChild("leaderstats"):WaitForChild("Stage") player.CharacterAdded:Connect(function(character) print("Character Added!") local StagePart = game.Workspace:FindFirstChild(Stage.Value) print(StagePart) character.HumanoidRootPart.Position = StagePart.Position + Vector3.new(0, 5, 0) print("Done!") end) end)
The script is supposed to spawn a character on a stage part. The problem is that it doesn't do that. I have tried debugging it by print and I have tried doing it by Humanoid.Died as well. Also, Stage is a string value.
Hi! Try using CFrame instead. Fixed Code:
game.Players.PlayerAdded:Connect(function(player) print("Player Added Yay!") local Stage = player:WaitForChild("leaderstats"):WaitForChild("Stage") player.CharacterAdded:Connect(function(character) print("Character Added!") local StagePart = game.Workspace:FindFirstChild(Stage.Value) --Just incase use the tostring() function to make a it a string. print(StagePart) character.HumanoidRootPart.CFrame = CFrame * CFrame.new(0, 5, 0) --Its supposed to be times not add btw print("Done!") end) end)