Hopefully, you are using a localscript. You should make a variable defining the character since when a player joins, their character is initially set to nil. Also, idk if you want localPlayer or specifically you.
plr = game.Players.LocalPlayer
mouse = plr:GetMouse()
char = plr.Character or plr.CharacterAdded:wair()
mouse.KeyDown:connect(function(key)
if key == "t" then
if plr ~= nil then
local pos = char:WaitForChild("Torso").Position
plr:LoadCharacter()
char.Torso.CFrame = CFrame.new(pos)
end
end
end)
Although, I am not certain if this will work since you are loading the character and then setting the CFrame of the torso. The PlayerGui is cleared upon player respawn so this script might be removed. In the future, use UIS to handle keyboard input and such
4 comments
Doesn't work :(
There was a typo, lol. Line 3, at the end, supposed to be :wait(), not :wair()
Still doesn't work
":LoadCharacter()" doesn't work in local scripts.