How do I make a badge you earn on death? and how do I make it to where a npc can deal damage and also give you money if you kill it? so if you kill it you dont get anything except for money but if it kills you, you get the badge?
also to kill the zombie how do I make a dialogue give you a tool?
local id = 12345678 -- badge id here
local function awardBadge(player)
player.Character.Humanoid.Died:Connect(functiob()
game:GetService("BadgeService"):AwardBadge(player.UserId,id)
wait(5) -- amount of time it takes to respond
game.ReplicatedStorage.Tool:Clone().Parent = player.Backpack
end)
end
game.Players.PlayerAdded:Connect(awardBadge)
Not exactly sure what you mean by dialogue system but here’s something I could think of
local id = 1283272 -- id
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
game:GetService("BadgeService"):AwardBadge(player.UserId, id)
end)
end)
end)
for npc, use leaderboard for money and use humanoid.Died:Connect(function()
–code here to give money
end)
just disable respawn so player cant die for badge. and make it npc like lefthand.Touched means humanoid:TakeDamage() but make it whatever parts u want to damage player
--put in npc model not any parts--
local LeftArm = script.Parent:WaitForChild("Left Arm")
local RightArm = script.Parent:WaitForChild("Right Arm")
LeftArm.Touched:Connect(function(otherpart)
local found = otherpart.Parent:FindFirstChild("Humanoid")
if found ~= nil then
otherpart.Parent.Humanoid:TakeDamage(3) --3 is damage,change to any number
end
end)
RightArm.Touched:Connect(function(otherpart)
local found = otherpart.Parent:FindFirstChild("Humanoid")
if found ~= nil then
otherpart.Parent.Humanoid:TakeDamage(3) --3 is damage,change to any number
end
end)
I saw that but how would i make it to where after choice A the one were he accepts the quest it puts a sword into his inventory and perhaps after he kills a certain amount of zombies (5) it removes the sword and gives him (500 candy) I alr have the leaderstats setup with candy and money and a way to turn candy into money.