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

Why doesn't the player change appearance?

Asked by
Akozta 40
9 years ago
local plr = game.Players.LocalPlayer
local button = script.Parent
local appearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=13645"
local teleportLocation = CFrame.new(240.2, 0.5, -246.4) 


function Click()
    plr.CharacterAppearance = appearance
    plr.Character.Torso.CFrame = teleportLocation 
end

button.MouseButton1Down:connect(Click)

1 answer

Log in to vote
1
Answered by 9 years ago

You need to find a way to make the player reset or reload the character.

local plr = game.Players.LocalPlayer
local button = script.Parent
local appearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=13645"

function Click()
    plr.CharacterAppearance = appearance
    plr:LoadCharacter() --Look up the load character function!
end

button.MouseButton1Down:connect(Click)

Server script in workspace or something

local teleportLocation = CFrame.new(240.2, 0.5, -246.4) 

game.Player.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(char)
        if player.CharacterAppearance == "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=13645" then --If the character looks like telamon!
            char.Torso.CFrame = teleportLocation --Move here.
        end
    end)
end)

Do something like the above, I think you can think of something.


Hope this helps!

Ad

Answer this question