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

MeshId Can't assign id from a table by pressing a button Error??

Asked by 6 years ago
repeat wait() until game.Players.LocalPlayer.Character

local p = game.Players.LocalPlayer
local cd = game.StarterGui:WaitForChild("CustomizationData")
local l = script.Parent.Left
local r = script.Parent.Right
local chat = p.Character:WaitForChild('Hair') -- Created Hair Accessory with a MeshPart(Handle Inside it)
local hn = script.Parent.HNumber
local hid = {522589968,520462259}

local count = 0

function Update()
    chat:WaitForChild('Handle').MeshId = "rbxassetid://"..hid[count] -- It's supposed to insert the id from the table but it doesnt works
    hn.Text = count
end

r.MouseButton1Down:Connect(function()
    if count >= #hid then
    else
        count = count + 1
        Update()
    end
end)

l.MouseButton1Down:Connect(function()
    if count > 1 then
        count = count - 1
        Update()
    end
end)

Anyway I tried making the Hair or Hat Customization and then comes up an error says

Unable to assign property MeshId. Script write access is restricted ? what does that means .. why I can't change the id of an MeshPart from the localscript

1 answer

Log in to vote
0
Answered by 6 years ago

That is because the MeshId property of MeshParts is marked as "NotAccessibleSecurity" meaning that it cannot be read or written by scripts. It can only be edited and seen by the studio properties menu. Because of that, your technique here won't work. :(

Wiki Page: here

Ad

Answer this question