local player = game.Players.LocalPlayer
local char = player.Character
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.ChangeShirtEvent:FireServer(char)
end)
serverscript:
local shirtId = "http://www.roblox.com/asset/?id=382538295"
game.ReplicatedStorage.ChangeShirtEvent.OnServerEvent:Connect(function(player, char)
char.Shirt.ShirtTemplate = shirtId
end)
for some reason when the local script fires the event, instead of applying the shirt to the player it just removes the player’s shirt and does nothing, can someone help?
local assetId = "382538295"
local success, item = pcall(function()
return game:GetService("InsertService"):LoadAsset(assetId)
end)
if success then
item.Parent = char.Shirt
end
local assetId = "382538295"
local success, item = pcall(function()
return game:GetService("InsertService"):LoadAsset(assetId)
end)
if success then
char:FindFirstChild("Shirt"):Destroy()
item.Parent = char
item.Shirt.Parent = char
item:Destroy()
end