User:Tomtomn00/Tale of the Tommy: RPG

Info

This is one of the projects to go on my profile. I am creating this game of mine, it will be finished soon. This includes some of the game scripts that anyone can use if you like.

RPG Logo: File:RPG-Tale of The Tommy LOGO.png RPG Spawn Location Design: File:Tottrpgspawn.png


Scripts

Stat-Give for when you kill a monster

local Humanoid = script.Parent.Enemy -- Monsters' Humanoid
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
	if tag ~= nil then 
		if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
			if Leaderstats ~= nil then 
Leaderstats.Gold.Value = Leaderstats.Gold.Value + 20 -- Money giver
wait(0.1)
script:remove()
			end 
		end 
	end 
end 
Humanoid.Died:connect(PwntX_X) 

local Humanoid = script.Parent.Enemy -- Monsters' Humanoid
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator")
	if tag ~= nil then
		if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
			if Leaderstats ~= nil then
Leaderstats.EXP.Value = Leaderstats.EXP.Value + 20 -- EXP giver
wait(0.1)
script:remove()
			end
		end
	end
end
Humanoid.Died:connect(PwntX_X)