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

Script gives outfit in Studio, not in game?

Asked by 9 years ago

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

1
If this is in a Localscript, try it in a regular script, and vise versa . dyler3 1510 — 9y
0
Cheers, that worked! Put it as an answer and I'll accept it! :3 Michael007800 144 — 9y
0
Ah ok, lol. Glad to help :P dyler3 1510 — 9y

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

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.

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! Michael007800 144 — 9y
Ad

Answer this question