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

Why won't it clone the tool when they click the part?

Asked by 4 years ago
Edited 4 years ago
game.Workspace.C.ClickDetector.MouseClick:Connect(function(click)
    local clone = game.Workspace.C:Clone()
    clone.Parent = click.Backpack
end)

Idk why I don't know how to do this...

0
because click is the player who clicked the part, and the parent of it is the players service, which isnt a character theking48989987 2147 — 4y
0
so you can essentially get rid of the player variable entirely theking48989987 2147 — 4y
0
Okay thanks bluemountainlion 56 — 4y
0
so then how is the script supposed to look like? bluemountainlion 56 — 4y
View all comments (3 more)
0
without lines 1, 3, 4, and 7 User#24403 69 — 4y
0
oh and change line 6 player1 to click User#24403 69 — 4y
0
But it still doesn't work bluemountainlion 56 — 4y

1 answer

Log in to vote
-1
Answered by
KDarren12 705 Donator Moderation Voter
4 years ago

Use "MouseButton1Click" to determine a left click (MouseButton2Click for a right click).

game.Workspace.C.ClickDetector.MouseButton1Click:Connect(function(click)
    local clone = game.Workspace.C:Clone()
    clone.Parent = click.Backpack
end)
0
I hope this can help you since this looks like not much help. Since you edited the question I don't fully understand the initial problem, but, tell me if it works, @bluemountainlion. KDarren12 705 — 4y
0
@KDarren12 17:20:48.519 - MouseButton1Click is not a valid member of ClickDetector bluemountainlion 56 — 4y
Ad

Answer this question