I really suck at scripting but how do I make it so when an npc is killed,a block that is transparent becomes non transparent and reappears. For example, when I kill an npc, I want this checkpoint to appear.
I think I have the script but I don't know how to use it.
NPC.Humanoid.Died:Connect(function() part.Transparency = 0 end)
First we need the NPC and the part
local NPC = workspace.NPC or workspace:waitForChild("NPC") -- Change the "NPC" to your likes local part = workspace.ThePart or workspace:WaitForChild("ThePart") -- Make sure that the part's name is not "Part", change it to anything else, like "ThePart" NPC.Humanoid.Died:Connect(function() if NPC.Humanoid.Health <= 0 then part.Transparency = 0 end end)
Paste this inside a normal (server) Script, into the workspace. I hope this works
The script is correct, just paste it somewhere in a script and make sure to set NPC
and part
to the correct instances.
For example if the script is within the NPC then NPC would be local NPC = script.Parent
and part
would be local part = game.Workspace.Part -- or whatever the other part is named
.