Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

2 comments

0

remotes

0

Get their mouse with :GetMouse() instead, it's much simpler.

1 answer

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

needs to be:

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

1 comment

0

But would this make it compatible with FE?

This discussion is preserved as it was. New answers, comments, and votes are closed.