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

Trying to size down accessory's handle but Handle is an unknown global?

Asked by
orcsem 7
4 years ago

So what I'm trying to do is I want every accessory on a player to be resized to 0.1

game:GetService("Players"):Connect(function(player)
player.CharacterAdded:Connect(function(character)
    wait(1)
    for i,v in pairs(character:GetChildren()) do
        if v:IsA("Accessory") then
            v:FindFirstChild("Handle")
                if Handle then
                Handle.Size = Vector3.new(0.1, 0.1, 0.1)
            end
            end
        end
    end)
end)

I am not well experienced with this kind of scripting. I have followed everything in this tutorial Instance:FindFirstChild, but Handle is still an unknown global. Can someone tell me what's wrong?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

line 6 and 7, first you do v:FindFirstChild("Handle") but you are not doing anything with this, you aren't storing it, and you definitly aren't setting something about it i think you meant to set the variable "Handle" to v:FindFir... but you didn't.

It should also be noted that this will not actually size down the instead you should be resizing the mesh.

game:GetService("Players").PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
    wait(1)
    for i,v in pairs(character:GetChildren()) do
        if v:IsA("Accessory") then
            local Handle = v:FindFirstChild("Handle")
                if Handle then
                Handle.Size = Vector3.new(0.1, 0.1, 0.1)
                end
            end
        end
    end)
end)
0
I'm no longer getting errors in the script, but ingame it says Connect isn't a valid member of Players orcsem 7 — 4y
0
Also I was actually going to size down the handle and not the mesh because of hitbox issues orcsem 7 — 4y
0
i made a whoopsiedaisy, should work now fanofpixels 718 — 4y
0
Thank you! It's working now orcsem 7 — 4y
Ad

Answer this question