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

Admin script getting a shirt template?

Asked by 7 years ago
Edited 7 years ago

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

0
Not good enough of an attempt. INOOBE_YT 387 — 7y
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. User#5423 17 — 7y
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 Troidit 253 — 7y
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. Mayk728 855 — 7y
0
Thank you! I didn't think of that. ScrappyHaxor 8 — 7y

Answer this question