Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

viewmodel check for clothes won't update the viewmodel, any help?

Asked by 2 years ago

I made a little script that checks every frame if the player's character has any body colors, or a shirt on their character. It doesn't seem do actually be working though, if anybody can help it would be very appreciated.


function checkViewmodel(plr,char,playerviewmodel) if char then if not playerviewmodel:FindFirstChild("Shirt") or not playerviewmodel:FindFirstChild("Body Colors") then for i,v in pairs(char:GetChildren()) do if v:IsA("Shirt") or v:IsA("BodyColors") then local item = v:Clone() item.Parent = playerviewmodel end end end end end game:GetService("RunService").RenderStepped:Connect(function() checkViewmodel(player,character,PlayerView) end)
0
This is done through a local script by the way, the player, character, viewmodel, etc already have a variable attached to it jorcorrs 76 — 2y
0
Ok, the script is actually working. Are you sure that you are waiting for the character and not just instantly assigning it? xXMadonXx 190 — 2y
0
My current best guess is that you made a mistake when assigning the variables xXMadonXx 190 — 2y
0
is there a way i can wait for the player's character? because i've tried a lot of different things and this was the cleanest way i could think of doing it jorcorrs 76 — 2y

1 answer

Log in to vote
1
Answered by
xXMadonXx 190
2 years ago
Edited 2 years ago
local character = player.Character or player.CharacterAdded:Wait()

If you do not wait for the character, the value is nil

Ad

Answer this question