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

ROBLOX Broke my script, can someone fix it?

Asked by 10 years ago

bin = script.Parent

function onButton1Down(mouse)

local model = bin.model:clone()

model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(mouse.hit.p)

script.Parent:Remove()

end

function onSelected(mouse) mouse.Icon = "rbxasset://textures\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end

bin.Selected:connect(onSelected)

2 answers

Log in to vote
0
Answered by 10 years ago

Let's see..

wait(0.1)
bin = script.Parent

function onButton1Down(mouse)
    local model = bin.model:clone()

    model.Parent = game.Workspace
    model:MakeJoints()
    model:MoveTo(mouse.Hit.p)

    script.Parent:Destroy()
end

function onSelected(mouse) 
    mouse.Icon = "rbxasset://textures\GunCursor.png" 
    mouse.Button1Down:connect(function() 
        onButton1Down(mouse) 
    end) 
end

bin.Selected:connect(onSelected)

Try it out, and say if it works or not.

Ad
Log in to vote
0
Answered by
Bebee2 195
10 years ago

Also, if it's a regular script, then the script won't work in a hopperbin because of an update 2-3 months ago (just noting that).

Use a LocalScript instead if it isn't already.

Answer this question