Hey, im making a viewmodel for my horror game, the thing is that, i want the player’s shirt to be put on the viewmodel, but for some reason, it does not work?
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
local shirt = c:FindFirstChildOfClass("Shirt")
local copyShirt = shirt:Clone()
copyShirt.Parent = script.Parent
end)
end)
(The script is located on the viewmodel and is a ServerScript)
Thanks!
Try to wait for character to be a part of workspace before trying.
repeat task.wait() until character.Parent
My ViewModel is in Replicated Storage, but for some reason when is in Workspace, it works, but when is in Replicated Storage, it does not work…
Then just parent the viewModel to workspace before putting on the shirt & pants?
So, i tried that, but it only works when is in workspace…
In workspace:
in ReplicatedStorage (after moving the viewmodel to rs)
Script:
wait()
script.Parent.Parent = game.ReplicatedStorage
???
Can you try to explain your whole process, so I have a better understanding on what you’re doing?
I’m confused. Why don’t you just add the Shirt in the LocalScript
that parents the ViewModel
to workspace?
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAppearanceLoaded:Wait()
local ViewModel = path.to.ViewModel
-- .... Wherever you parent the ViewModel to workspace
local ClonedViewModel = ViewModel:Clone()
local Shirt = Character:FindFirstChildOfClass("Shirt")
if (Shirt ~= nil) then Shirt:Clone().Parent = ClonedViewModel end
ClonedViewModel.Parent = workspace