What I’m trying to make is like a goblin enemy for a tycoon game I’m working on, and when killed, it should drop gold. (Gold is like a “cash” leaderstat that players can use to buy new gear) I’ve tried to make it over and over again, but nothing works. Can anyone help?
1 Like
Do you have any code I could work with? Just to get a feel of what you are doing, and the environment you are building it in.
I add a tag into the NPC when a players weapon hits which contains the players name. This is done in the weapon serverscript in the Touched event, when you check what your weapon has hit.
Then when the NPC dies, in the serverscript that controls it, I have a Humanoid.Died:Connect
that looks at any tags, then gives that player the points/cash/bunnies.
Obviously, you need leaderstats setup for the player as well, see Roblox Education - Leaderboards for that.
I recommend checking out their other Tutorials as they have taught me more than the DevForum so far as I am still learning.
1 Like