What I'm try to do is, when player press an object, the object will be destroyed and 2 tools in replicated storage will be given to player who press the object, but somehow, the output say the same thing as the title, Here is the SERVER SCRIPT:
local GrassTool = game:GetService("ReplicatedStorage").Storage.Tools.Grass:Clone() local LogTool = game:GetService("ReplicatedStorage").Storage.Tools.Log:Clone() local Tree = script.Parent.Parent local ObtainedFolder = game:GetService("ReplicatedStorage").Storage.ObtainedObject local HealthBar = game:GetService("ReplicatedStorage").Storage.Gui.NormalTree.TreeHealthGui:Clone() function giveGear(player) LogTool.Parent = player.Backpack GrassTool.Parent = player.Backpack end function onClick(Clicker) HealthBar.Parent = Clicker.PlayerGui HealthBar.Enabled = true Tree.Health.Value -= 1 if Tree.Health.Value == 0 then giveGear() HealthBar.Enabled = false HealthBar:Destroy() else --Nothing end end script.Parent.MouseClick:Connect(onClick)
Any help would be appreciated!
you forgot to index the arg in the function
giveGear(Clicker)