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 1 year 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 — 1y
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 — 1y
0
My current best guess is that you made a mistake when assigning the variables xXMadonXx 190 — 1y
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 — 1y

1 answer

Log in to vote
1
Answered by
xXMadonXx 190
1 year ago
Edited 1 year 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