Hello. I made a cup part, when it is clicked it should give the player who clicked it a tool. That isn't happening though. The output gives no error either.
Here is the script:
game.Players.LocalPlayer:WaitForChild('Backpack')
function onClicked(plr)
if plr:GetRankInGroup(3983801) >= 2 then
local sc1 = game.ServerStorage.Tools.Cups.WhiteCups.SmallEmptyCup:Clone()
sc1.Parent = game.Players.LocalPlayer.Backpack
sc1.Name = ('Small Empty Cup')
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Help would be appreciated.
Thanks

3 comments
Is it inside a LocalScript or a Script?
This is inside of a LocalScript.
if plr:IsInGroup(3983801) and ...?