Weapon = game.Workspace.Lighting.Musket script.Parent.MouseClick:connect(function(PlayerClicked) Weapon:clone().Parent = Player.Backpack script.Parent. end <== end script.Parent.MouseClick:connect --Currently under ClickDetector (should I ungroup it w/ the ClickDetector or keep it with it?
This script is currently in a "prop" weapon that was placed so that when a player clicked it, the tool itself would be cloned into the person's backpack. Tell me where the error is but in studio in the "end" where the arrow is pointing, it says '<name>' expected near 'end'.... So this means?
Weapon = game.Workspace.Lighting.Musket -- assuming "Lighting" is a member of Workspace and you aren't trying to get the Lighting service. script.Parent.MouseClick:connect(function(PlayerClicked) Weapon:clone().Parent = PlayerClicked.Backpack --script.Parent. Why was this part in there? This is the error. end) -- <== --Currently under ClickDetector (should I ungroup it w/ the ClickDetector or keep it with it?
Errors: Lighting may be used incorrectly.
It should be PlayedClicked instead of Player
The random script.Parent.
1 extra end
the event end should be closed with a parenthesis.
Error: Line 1
Lighting
is not a child of Workspace
. It's a child of game
just like Workspace.
Weapon = game.Lighting.Musket
You had two many ends, and you never closed your :connect(). That's why you got the problem.
Weapon = game.Workspace.Lighting.Musket script.Parent.MouseClick:connect(function(Player) x = Weapon:clone() x.Parent = Player.Backpack end)