I'm trying to make a simple gui that lets you change your character appearance, then auto respawns you. The problem is, I know that I can't use LoadCharacter in a LocalScript. I really don't want to kill the character, so how would I use LoadCharacter?
--[[This is a LocalScript in the "OK" TextButton. I based the
variables on the ScreenGUI object instead of using script.Parent
so you could get a clearer understanding of the hierarchy.
--]]
player = game.Players.LocalPlayer
repeat wait() until player.Character
character = player.Character
gui = script.Parent.Parent.Parent --The ScreenGUI object
input = gui.Frame:WaitForChild("Input") --The TextBox
ok = gui.Frame:WaitForChild("OK") --The TextButton
invalid = gui.Frame:WaitForChild("Invalid") --The TextLabel for errors
ok.MouseButton1Click:connect(function()
local id = input.Text
local baseurl = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="
if not tonumber(id) then
invalid.Text = "Invalid user ID."
else
invalid.Text = ""
player.CharacterAppearance = baseurl..id
end
end)

2 comments
I'd say the Bindable or server thingies, obviously the way I'm saying it shows I don't know how to use them, but I'm pretty sure that's what you'd do....
I would personally use a RemoteEvent.