Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Refreshing a player without killing?

Asked by 9 years ago

is there a way that I can refresh a player without killing them? This script changes their apperance but I made it so it kills them and re teleports back is there another way to do it?

textbox = script.Parent.TextBox
player = game.Players.LocalPlayer
script.Parent.Button.MouseButton1Click:connect(function()
if textbox.Text == "Loleris" then
player.CharacterAppearance = 'http://www.roblox.com/Asset/CharacterFetch.ashx?userId=2312310&placeId=0'
pos = Instance.new("Part", game.Workspace)
pos.CanCollide = false
pos.Transparency = 1
pos.CFrame = player.Character.Torso.CFrame * CFrame.new(0,-3,0)
player.Character.Humanoid.Health = 0
wait(12)
player.Character.Torso.CFrame = pos.CFrame * CFrame.new(0,3,0 )
pos:Remove()
end
end)

1 answer

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

Simply use the LoadCharacter method of Player. It literally loads the character (derp). It creates a new character for the player, removing the old one. Also clears the player's Backpack and PlayerGui.

player:LoadCharacter()
0
Can only be accepted on backend server Timster111 25 — 9y
0
? Perci1 4988 — 9y
Ad

Answer this question