I have a UI that will soon let you put on a jacket. when they are equipted they look like this in the player model
Arm1, Arm2, Chest, I have added a button to the ui to remove all. Thats why
remoteEvent.OnServerEvent:Connect(function(player, val)
if val == "Event_Remove_Jackets" then
print("Staff_UI_Priority Event fired.")
print("Staff_UI_Priority Event: ", val)
LPlayer:WaitForChild("Arm1"):Destroy()
LPlayer:WaitForChild("Arm2"):Destroy()
LPlayer:WaitForChild("Chest"):Destroy()
end
end)
--// Staff UI Remote Event \\--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("Staff_UI_Priority")
--// Game Stuff \\--
local Character = game.Players.LocalPlayer.Character
--// Jackets \\--
remoteEvent.OnServerEvent:Connect(function(player, val)
if val == "Event_Remove_Jackets" then
print("Staff_UI_Priority Event fired.")
print("Staff_UI_Priority Event: ", val)
Character:WaitForChild("Arm1"):Destroy()
Character:WaitForChild("Arm2"):Destroy()
Character:WaitForChild("Chest"):Destroy()
end
end)
You cannot get LocalPlayer on a server script, however you can use the player argument that’s in the first parameter of the OnServerEvent, it returns the player that fired the event, so instead of using Character use player.Character