This script is intended to be used if jumping into an out of bounds area in order to prevent leaving the map, it just respawns the player but more than not it crashes my game, any reason why?
script.Parent.Touched:Connect(function(Hit) local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Player then Player:LoadCharacter() end end)
Add a debounce. I believe it may crash because it keeps loading the character for an infinite amount of times.
local debounce = false script.Parent.Touched:Connect(function(Hit) local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Player then if debounce == false then debounce = true Player:LoadCharacter() wait(.01) debounce = false end end end)