I have a script that applies a specific Uniform to the player when they click it on the GUI. I tried adapting it to work with Tshirts but it seems to not work. I tried using this
local Event = Instance.new("RemoteEvent") Event.Parent = game.ReplicatedStorage Event.Name = "Badge2" local ShirtGraphic = "rbxassetid://5128483529" function GiveUni(plr) local character = plr.Character local shirtgraphic = character.ShirtGraphic local pants = character.Pants shirtgraphic.Graphic = ShirtGraphic end Event.OnServerEvent:Connect(GiveUni)
But only to get the following error.
01:08:05.942 - ShirtGraphic is not a valid member of Model 01:08:05.944 - Stack Begin 01:08:05.944 - Script 'ServerScriptService.Badge2', Line 8 - function GiveUni 01:08:05.945 - Stack End
So I'm confused as to where to go from here any help will be appreciated.
You used the same variable twice:
local Event = Instance.new("RemoteEvent") Event.Parent = game.ReplicatedStorage Event.Name = "Badge2" local Shirtgraphic = "rbxassetid://5128483529" -- Same variable as line 7 used to be here. function GiveUni(plr) local character = plr.Character local shirtgraphic = character.ShirtGraphic local pants = character.Pants shirtgraphic.Graphic = ShirtGraphic end Event.OnServerEvent:Connect(GiveUni)
Should Work. Or else try this:
local Event = Instance.new("RemoteEvent") Event.Parent = game.ReplicatedStorage Event.Name = "Badge2" local Shirtgraphic = "rbxassetid://5128483529" function GiveUni(plr) local character = plr.Character local shirtgraphic = character.ShirtTemplate local pants = character.PantsTemplate shirtgraphic.Graphic = ShirtGraphic end Event.OnServerEvent:Connect(GiveUni)