You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
so, my script is where you activate a proximity prompt, then it clones a part in replicatedstorage to go towards a part and explode, how do i make it so that when it explodes it has creator tags
What is the issue? Include screenshots / videos if possible!
i am a beginner/moderate scripter and i have not dug into anything about creator tags yet!
Sorry in advance if this doesn’t make a lot of sense from the lack of resources, but here is what I learned from searching.
A creator tag is an “ObjectValue” that we put in the character.Humandoid for later use. We assign the value of the objectValue to the player that inflicted the damage to the player. After that we can use a script like this:
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character.Humanoid.Died:Connect(function()
local creator = character.Humanoid:FindFirstChild("creator") -- creator is what I named the objectValue
local leaderstats = creator.Value:FindFirstChild("leaderstats")
if creator ~= nil and creator.Value ~= nil then
print(creator.Value)
end
end)
end)
end)
So this gives us back what player hit the player last before they died.
The rest of what I’ll be talking about is extra if you want to make sure the player doesn’t get a point if they dead player jumps off the world.
So this is fairly simple all we have to do is after damage is inflicted wait an amount of seconds and set the creator tag back to nil for it to count as no one got the kill. There are some holes like if the player got hit than jumps off but hopefully this helps and does not make it more confusing. If you have more questions feel free to ask!
hi, sorry i responded late, thank you for this explanation except uh, i already figured it out and i forgot to change this im sorry!! i really appreciate it though once again i am really sorry and thank you