of     1   

Josh_RTG
#204070400Saturday, December 10, 2016 10:43 PM GMT

Why won't this script work? local player = game.Players.LocalPlayer local clone = game.ReplicatedStorage.Pyro:Clone() script.Parent.ClickDetector.MouseClick:connect(function() clone.Parent = player.Backpack end) It's in a local script, in a part with a clickdetector. The name of the tool is correct.
SamTheLollipop
#204071552Saturday, December 10, 2016 10:59 PM GMT

Use a normal Script, and paste this into it: local player = game.Players.LocalPlayer local clone = game.ReplicatedStorage.Pyro:Clone() function onClicked(hit) clone.Parent = game.Players[hit.Name].Backpack end script.Parent.ClickDetector.mouseClick:connect(onClicked) #code web.workspace.Player63541429.Name = "SamTheLollipop"
SamTheLollipop
#204071620Saturday, December 10, 2016 11:00 PM GMT

whoops, local player is useless local clone = game.ReplicatedStorage.Pyro:Clone() function onClicked(hit) clone.Parent = game.Players[hit.Name].Backpack end script.Parent.ClickDetector.mouseClick:connect(onClicked) #code web.workspace.Player63541429.Name = "SamTheLollipop"
Josh_RTG
#204072385Saturday, December 10, 2016 11:11 PM GMT

Thanks!
Josh_RTG
#204073566Saturday, December 10, 2016 11:27 PM GMT

It only works for the first player to click it, doesn't work if another player clicks after that player. Any solution for this?
Josh_RTG
#204084301Sunday, December 11, 2016 1:26 AM GMT

Bump
Josh_RTG
#204119629Sunday, December 11, 2016 11:06 AM GMT

Buuump
SinisterMemories
#204123447Sunday, December 11, 2016 12:38 PM GMT

I dont think you can use localplayer in a normal script. I made that mistake today. local doesnt work in a normal script im pretty sure
Josh_RTG
#204123802Sunday, December 11, 2016 12:46 PM GMT

I'm not using a normal script, I'm using a local script. I tried @SamTheLollipop's method but it doesn't work.
SinisterMemories
#204124154Sunday, December 11, 2016 12:54 PM GMT

function onClick(click) for i,v in pairs (game.ReplicatedStorage:GetChildren()) do if v.ClassName == "Pyro" and not click.Backpack:FindFirstChild(v.Name) and not click.Character:FindFirstChild(v.Name) then c = v:Clone() c.Parent = click.Backpack end end end script.Parent.ClickDetector.MouseClick:connect(onClick) Try that,
Josh_RTG
#204124544Sunday, December 11, 2016 1:02 PM GMT

That doesn't seem to work. I used a normal script, was it supposed to be a local?
Josh_RTG
#204124955Sunday, December 11, 2016 1:10 PM GMT

Doesn't work in a local script either.
Josh_RTG
#204128918Sunday, December 11, 2016 2:24 PM GMT

Bump
Josh_RTG
#204134387Sunday, December 11, 2016 3:49 PM GMT

Still need help with this ;(
SinisterMemories
#204178454Monday, December 12, 2016 12:20 AM GMT

i made some mistakes, lol function onClick(click) -- The Function , rename if you want. for i,v in pairs (game.Lighting:GetChildren()) do if v.ClassName == "Pyro" then -- Already renamed the tool for you c = v:Clone() c.Parent = click.Backpack -- Rename "click" if you rename it on line 1 end end end script.Parent.ClickDetector.MouseClick:connect(onClick)
mrmario04
#214265368Thursday, April 13, 2017 10:07 PM GMT

Modes local script only do something on ### screen or am I wrong?
mrmario04
#214265400Thursday, April 13, 2017 10:08 PM GMT

Does, auto correct
Hazzatr0m
#214272299Thursday, April 13, 2017 11:41 PM GMT

Using a local script isn't very practical due to ROBLOX going towards FilteringEnabled. It's better to use a script as it would only be replicated to the player that the script belongs to. Anyway, the issue is that you need to replicate the tool every time the player click on the part, not just once. You should replicate the tool in the function function onClicked(hit) local clone = game.ReplicatedStorage.Pyro:Clone() clone.Parent = game.Players[hit.Name].Backpack end script.Parent.ClickDetector.MouseClick:connect(onClicked) Also, mouseClick is deprecated; you should use MouseClick in new projects. This is my signature. R$0
Dev_Icy
#214274348Friday, April 14, 2017 12:11 AM GMT

Insert the clone into the function, right now it only creates a single clone, so once that happens, there are no more clones available.

    of     1