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

Character Appearance Help? #3

Asked by
Vividex 162
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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...

0
It just breaks the script and I don't get char'd, says "Expected identifier, got ')' on line 15" Vividex 162 — 9y
0
Okay let me fix it. EzraNehemiah_TF2 3552 — 9y
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. Vividex 162 — 9y
0
Oh. EzraNehemiah_TF2 3552 — 9y
View all comments (2 more)
0
Works, thanks! Vividex 162 — 9y
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. EzraNehemiah_TF2 3552 — 9y
Ad

Answer this question