so I have this game where I have a GUI Text button with a local script inside it that sends a remote event to server script storage to activate a script, but the server script isn't working as intended
Client
script.Parent.MouseButton1Click:Connect(function()
wait(0.8)
game.ReplicatedStorage.TransformBack:FireServer()
end)
Server
game.ReplicatedStorage.TransformBack.OnServerEvent:connect(function(player)
local Char = player.Character or player.CharacterAdded:wait()
local Torso = Char:FindFirstChild("LowerTorso")
local Morphs = workspace:FindFirstChild("Morphs")
local PlrGui = player:FindFirstChild("PlayerGui")
local Pos = Torso.Position
--(6.3, 1324.96, 31.38) original pos
local p = Instance.new("Part")
p.Anchored = true
p.Transparency = 1
p.CanCollide = false
p.CFrame = CFrame.new(Pos)
player:LoadCharacter()
wait(0.3)
Torso.CFrame = CFrame.new(p.Position)
p:Destroy()
end)
yeah I'm guessing the script loads the character and looses the player, and so the script doesn't continue.. what am I doing wrong?

2 comments
Nope, still respawning at spawn..
ok wait ill make a teleport script for you