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

Script gives outfit in Studio, not in game?

Hey guys!

I have this script here where if you click on the GUI, it gives you the outfit. It works fine in Studio test mode, but not in-game. Does anyone see an error with my code?

script.Parent.MouseButton1Down:connect(function()
playername = script.Parent.Parent.Parent.Parent.Name
playerteam = script.Parent.Parent.Parent.Parent
player = Workspace:FindFirstChild(""..playername.."")
if player ~= nil then
	player:FindFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=267460168"
	player:FindFirstChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=267460509"
end
end)

Thanks in advanced,

Michael

3 comments

1

If this is in a Localscript, try it in a regular script, and vise versa .

0

Cheers, that worked! Put it as an answer and I'll accept it! :3

0

Ah ok, lol. Glad to help :P

1 answer

✓ Accepted answer

Try to put it in a LocalScript if it's already in a regular script, and vise versa. If it works in studio, but not in game, then this will almost always fix it.

1 comment

0

It works, the the annoyance is that the outfit is now only visible Locally. Only the wearer can see the outfit, no-one else!

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