A few scripting things I need help with! Like badge on death and dialogue gives you tool!

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 badge = 1 -- Badge Here

game.Players.PlayerAdded:Connect(function(player)

  player.Character.Humanoid.Died:Connect(function()

    BadgeService:AwardBadge(player.UserId,badgeI)

  end)

end)

Try this for your first request

2 Likes
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

2 Likes

Dialogue like the built in roblox dialogue
112

I tried and it didn’t work? it never gave it when the player died and it said it couldn’t find Humanoid

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)

wait lemme fix it
i forgot to do humanoid

done,try now

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

ok I alr got that but how do I make the npc do damage to the player? like what would the script be

r6 or r15? i need info so ik parts

it worked! thx for the help with the badge

1 Like

its r6! the npc’s and players are r6

r6:

--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)

from my experience,it usually works

also for tool try makin script and learnin from Dialog | Roblox Creator Documentation

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.

name it differently so script can find it.

for amount of zombies just make a numbervalue and rename it,tell me name

actually nvm! i’ll just make it a part in the graveyard.

ok so this post is solved? hmm