I am making a game where you kill NPC. but i can not figure out how to write this.(The script is to give gold to me when i kill an npc) Located in startergui:
local player = script.Parent.Parent
local leaderboard = player:WaitForChild("leaderstats")
local currency1 = leaderboard:WaitForChild("Gold")
function onDied()
print("Dead")
currency1.Value = currency1.Value + 100
end
script.Parent.Parent.Workspace.TutPrac.Viking.Humanoid.Died:connect(onDied)
Thanks!
