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

Unable to assign property MeshId. Script write access is restricted???

Asked by
5xbh 17
3 years ago

Is there any way to bypass this? If there is, I would really love to find out how, I'm attempting to make a matter gun which has a SurfaceGui that can change the Mesh and Texture of the MeshPart being fired, but I apparently can't change the MeshId without running into an error. Any fix would be greatly appreciated!

script.Parent.MouseButton1Click:Connect(function()
    local ma = game:GetService("ReplicatedStorage"):WaitForChild("Matter")
    if script.Parent.Parent.Frame.Speed.Text == "" then
        return
    else
        game:GetService("ReplicatedStorage"):WaitForChild("Matter"):SetAttribute("Speed",script.Parent.Parent.Frame.Speed.Text)
    end
    local m = game:GetService("ReplicatedStorage"):WaitForChild("Matter"):Clone()
    m.Parent = game:GetService("ReplicatedStorage")
    game:GetService("ReplicatedStorage"):WaitForChild("Matter"):Destroy()
    if script.Parent.Parent.Frame.Mesh.Text == "" then
        return
    else
        m.MeshId = script.Parent.Parent.Frame.Mesh.Text
    end
    if script.Parent.Parent.Frame.Texture.Text == "" then
        return
    else
        m.TextureID = script.Parent.Parent.Frame.Texture.Text
    end
end)

Answer this question