I'm having a bit of trouble with my admin script. I'm trying to make a shirt command that changes the players shirt. But i am getting the request failed errors. The solution would be subtracting the id until it works.

But the problem is.. How do i know if it works in a script? How does the script know if it should keep subtracting or keep the current id?

This is all i have so far

Target.Character.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. id

ID is the parameter included with the command and target is the target that the player (the admin) is targetting.

(I've already found the target, done the admin check and checked that the target isn't nil)

Please help me.

-ScrappyHaxor

5 comments

0

Not good enough of an attempt.

0

Check that the id is valid, if you put the id in a shirt instance in studio it should format it correctly for you.

0

I've never used pcall before, but you should be able to just use pcall to check if the id is valid. like: if pcall((complete assetid)) then return true end

0

His attempt is good enough. Down voting was really unnecessary. Also, the script doesn't automatically subtract the ID so you would have to use InsertService to insert the shirt and parent it to the model.

0

Thank you! I didn't think of that.