Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Hello I made a tag script to detect who gets enemy rewards but for some reason it doesnt work?

I put this tag script in my sword so that whenever i hit a enemy itll automatically tag it but for some reason it doesnt work here is the tag script in the sword

game.ReplicatedStorage.Tag.OnServerEvent:Connect(function(Useless,Character) -- This is for my local script that gives the Enemy
local Player = script.Parent.Parent.Parent
if Player.Tag.Value == "Not" then
Player.Tag.Value = Character.Name

end

end)


Here is the script i put in the enemy

script.Parent.Died.Event:Connect(function() -- When i copied this model this was to detect when the enemy died this is a bindable event they put if u wanna know
for _, v in pairs(game.Players:GetChildren()) do
if v.Tag.Value == script.Parent.Name then
v.Exp = v.Exp + script.Parent.Exp.Value
v.Tag.Value = "Not"

end
end
end)

please help me

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.