So, basically I'm having trouble trying to get the reward to be given to the player.
local human = script.Parent:WaitForChild("Humanoid") human.Died:Connect(function() local tag = human:FindFirstChild("creator") if tag ~= nil then local stats = game:GetService("Players"):FindFirstChild(tag.Value).leaderstats if stats then print("heres ur money") Gold.Value = Gold.Value+script.Parent.Settings.Gold.Value end end end)
Try this:
script.Parent:WaitForChild("Humanoid").Died:Connect(function() local tag = human:FindFirstChild("creator") if tag ~= nil then local stats = game:GetService("Players").leaderstats:WaitForChild(tag.Value) if stats then print("heres ur money") Gold.Value = Gold.Value + script.Parent.Settings.Gold.Value end end end)