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

Need help with Model 2 Script plugin (function)? [closed]

Asked by
iPxter -7
5 years ago

First part of the script (supposed to implement scripts into parts of the model)

function sandbox(var,func)
    local env = getfenv(func)
    local newenv = setmetatable({},{
        __index = function(self,k)
            if k=="script" then
                return var
            else
                return env[k]
            end
        end,
    })
    setfenv(func,newenv)
    return func
end
cors = {}
table.insert(cors,sandbox(Script243,function()
function Touched(body) 
if body.Parent:findFirstChild("Humanoid") ~= nil then 
body.CanCollide = false 
body.Parent.Torso.Transparency = 0.001
body.Parent.Head.Transparency = 0.001
body.Parent["Left Arm"].Transparency = 0.001
body.Parent["Right Arm"].Transparency = 0.001
body.Parent["Left Leg"].Transparency = 0.001
body.Parent["Right Leg"].Transparency = 0.001
end 
end 
script.House.InsideStuff.MakeGlass.Touched:connect(Touched)

function onTouched(hit) 
    local d = hit.Parent:GetChildren() 
    for i=1, #d do 
        if (d[i].className == "Accessory") then 
                for i, v in pairs(d[i]:GetChildren()) do
                    if v:IsA("Part") and
                        v.Name == "Handle"
                        then
v.Transparency = 0.001
                        end
    end
        end 
    end
end 

script.House.InsideStuff.MakeGlass.Touched:connect(onTouched)
end))

Function that gives me errors.^

Thanks for the help.

0
This isn’t even your code. I can tell from the deprecated code. User#19524 175 — 5y
0
Please only post questions for your own code. We will not fix free models or plugins for you. minikitkat 687 — 5y

Closed as Not Constructive by User#19524 and minikitkat

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?