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

How to use a tool to clone a part and place it where a player clicks?

Asked by 5 years ago

So, earlier I asked a question, but it didn't seem to help me when people said use Tool.Activated, so I still need help. This LocalScript code is so a model inside of this HopperBin can be placed where a player clicks. It only shows on the client, but I need it to appear on the server as well. How can I convert this to be compatible with FE? Inside of HopperBin !Hopperbin LocalScript

local Tool = script.Parent

UseValue = 20



function PlaceSpike(Mouse)

local Strip = Tool.SpikeStrip:Clone()

Strip.Parent = game.Workspace

Strip:MoveTo(Mouse.Hit.p)

UseValue = UseValue - 1



if UseValue < 1 then

Tool:Destroy()

end

end



function Selector(Mouse)

Mouse.Button1Down:connect(function()PlaceSpike(Mouse)end)

end



Tool.Selected:connect(Selector)

Any help would be appreciated.

0
remotes 3dwardIsBack -10 — 5y
0
Get their mouse with :GetMouse() instead, it's much simpler. awfulszn 394 — 5y

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
5 years ago
Mouse.Button1Down:connect(function()PlaceSpike(Mouse)end)

needs to be:

Mouse.Button1Down:connect(function(PlaceSpike(Mouse))
0
But would this make it compatible with FE? PeyPeyPeytonn 0 — 5y
Ad

Answer this question