Clothing Doesn't Go On Avatar From Remote Event?
So I'm making a clothing game test where I want people to test the clothing I make. When I make a event that calls it publicly it shows the player as without a shirt/pants. I'm not sure why this is happening even tho I did everything right.
If you could help or just tell me what to do I would be grateful!
The Local Script I use to fire from Shirt button is:
02 | local Button = script.Parent |
03 | local localPlr = game.Players.LocalPlayer |
04 | local PutClothingEvent = game.ReplicatedStorage.Events.PutClothingEvent |
05 | local Id = script.Parent.Parent.Parent.ShirtId |
07 | Button.MouseButton 1 Click:Connect( function () |
08 | if localPlr.Character:FindFirstChild( "Shirt" ) then |
I used "http://www.roblox.com/asset/?id=" by the fact it showed in game like that. But it doesn't seem to appear
The other Local Script I use to fire from Pants button is:
02 | local Button = script.Parent |
03 | local localPlr = game.Players.LocalPlayer |
04 | local PutClothingEvent = game.ReplicatedStorage.Events.PutClothingEvent |
05 | local Id = script.Parent.Parent.Parent.PantsId |
07 | Button.MouseButton 1 Click:Connect( function () |
08 | if localPlr.Character:FindFirstChild( "Pants" ) then |
09 | PutClothingEvent:FireServer( "Pants" , "rbxassetid://" ..Id.Value) |
Same with "rbxassetid://" I used it and never appeard.
My Remote Event:
01 | PutClothingEvent.OnServerEvent:Connect( function (localPlr, clothingType, clothingId) |
02 | if clothingType = = "Shirt" then |
03 | local NewShirt = Instance.new( "Shirt" , localPlr) |
04 | NewShirt.Name = "Shirt" |
05 | localPlr.Character.Shirt:Destroy() |
06 | NewShirt.ShirtTemplate = clothingId |
07 | print (localPlr, "has just put on some shirt." ) |
09 | local NewPants = Instance.new( "Pants" , localPlr) |
10 | NewPants.Name = "Pants" |
11 | localPlr.Character.Pants:Destroy() |
12 | NewPants.PantsTemplate = clothingId |
13 | print (localPlr, "has just put on some pants." ) |
What I used should work, but I'm not sure if it is ROBLOX's fault or I did something wrong.
I tried my best explaining the best I could, but if you can help thank you!