ohhh you can put it as a function that the link i gave it above
and to run a function, place in a activated event when it hit a humanoid!
you just need a character of the player who activate!
I donât understand what you are trying to say.
i tried to say that:
function getPlayerFromCharacter(character) for _, player in pairs(game:GetService("Players"):GetPlayers()) do if player.Character == character then return player end end end
This function will find a player character which match with our character, after the matches, it will return our player which will be a creator value of this topic!
all you need is to call a function like this:
local player = getPlayerFromCharacter(tool.Parent) --because when you equip a --tool, a tool will be placed in a character. if player then -- when we received a result, it is our player --make a creator tag creator.Value = player end
So itâs a new script in ServerScriptService?
no, you just put in the sword script.
I put it in the place when the humanoid is about to get damaged?
Iâm sorry if Iâm annoying you with all these questions, itâs just that Iâm not a very good scripter.
no problem! if it still have an error, you can just call me!
yes, you put in that place
There is an error that says something with âConsider changing it to localâ
There is an error here saying that there is an Unknown Global âcreatorâ
i can fix! can you show me full? i think you might type it wrong
First change the add a local before a getplayerFromCharacter()
âexample local function getPlayerFromCharacter()
place a function on top of the script!
it wouldnt work there!
âexample
âfunction HERE
âthen follow with the other script
Like this?
the creator that i gave you is an example! i didnt definded it yet!
so the server dont know what creator is? it just a simple script as this!
local CreatorTag = Instance.new(âObjectValueâ)
CreatorTag.Name = âcreatorâ
CreatorTag.Value = player
CreatorTag.Parent = Hum
game.Debris:AddItem(CreatorTag, 2)
âchange the creatorTag to âcreatorâ!
yes! now it will work on every line because it is above all!
now after you do it, it will store a damager of a player so if the NPC died they can check on the list of the damager that did to the NPC and find a player that stored in a creator tag!
For some reason I canât actually do the animation and deal damage.
Any idea how to fix this?
Iâm going to go to bed now. Iâm going to check back in the morning.
you can try to use Robloxâs default ClassicSword, it have a creatortag data store for simplier working and you can just working out by making only a creatortag detection only!
Nice to you sticking around to help and remaining patient.
I used the ClassicSword, it still doesnât give me any cells.