Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Character Appearance Help? #3

Now that I have a script that only changes me to the character (Thanks to Dittoo) how do I loop it to continuously check if I am not the character, and If I'm not, it will change me to it, but If I am, it won't do anything (Like if I unchar'd myself how would I keep making it check if I'm the character and I'f I'm not it will change me to it) I was gonna do while true do but that would just keep changing me to the character when I am already the character. I also was thinking of doing an if then thing but I forgot how.

game:service'Players'.playerAdded:connect(function(Player)
    Player:waitForChild'Backpack';--// Waits until they have a backpack, moreof character recognition.

    if(Player.userId==39704067)then--// 39704067 is Vividex's userId.
        wait(.5);--// A bit more delay.
        Player.CharacterAppearance='http://www.roblox.com/Asset/CharacterFetch.ashx?userId=31790662';--// Changed their appearance to the specified characterappearance.

        delay(15,function()--// Same as wait(15), but more efficient.
            if(Player and ypcall(function()assert(Player.Parent==game:service'Players','');end))then
                Player:loadCharacter();
            end;
        end);
    end;

end);

1 answer

✓ Accepted answer

Easy, just make a while wait() do in the script. So every 0.003 seconds it will check for a player with a player ID of 39704067.

game:service'Players'.PlayerAdded:connect(function(Player)
    Player:WaitForChild'Backpack';--// Waits until they have a backpack, moreof character recognition.

    if(Player.userId==39704067)then--// 39704067 is Vividex's userId.

while wait() do
        Player.CharacterAppearance='http://www.roblox.com/Asset/CharacterFetch.ashx?userId=31790662';--// Changed their appearance to the specified characterappearance.
end


            end;
        end);

game:service'Players'.PlayerAdded:connect(function(Player)
    Player:WaitForChild'Backpack'

    if(Player.userId==39704067)then
wait(15)
Player:LoadCharacter()
end
            end)

I can't really test this in studio so...

6 comments

0

It just breaks the script and I don't get char'd, says "Expected identifier, got ')' on line 15"

0

Okay let me fix it.

0

All this does is keeps charing me to the person and respawning me. I'm talking about if I like do :unchar Vividex in like Kohls admin like if I unchar myself it will automatically turn me back to the character if someone unchar'd me or will make it so I can't be unchar'd back to my normal character.

0

Oh.

0

Works, thanks!

0

Took me a while because I thought you meant that if someone unchard you they will load your character too. So I was working on a script that would teleport the player and rotate them to the exact position they were at and load them when the CharacterAppearence changed. I never used Kohl's admin before.

This discussion is preserved as it was. New answers, comments, and votes are closed.