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

Why will this only work in solo mode?

Asked by 9 years ago

I put this into a regular script under a hopper bin, but for some reason it only works in solo mode.

function onButton1Down(mouse)
    local b = game.ReplicatedStorage.Torch:Clone()
    b.Parent = game.Workspace
    b.torchhandle.Position = mouse.Hit.p
    b.fireholder.Position=Vector3.new(b.torchhandle.Position.x,mouse.Hit.p.y+3.24900,b.torchhandle.Position.z)
end

function onSelected(mouse)
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
script.Parent.Selected:connect(onSelected)
0
This a local script or script? fireboltofdeath 635 — 9y
0
An ordinary script uberoverlord 15 — 9y

1 answer

Log in to vote
3
Answered by
LuaQuest 450 Moderation Voter
9 years ago

You're missing a 3rd argument on line 5, and it's syntactically incorrect by missing a closing parenthesis with Vector3. And you should always use a localscript with hopperbins.

0
Thanks uberoverlord 15 — 9y
Ad

Answer this question