Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
5

What is the 'creator' value? [closed]

Asked by
woodengop 1134 Moderation Voter
9 years ago

I've seen in some ROBLOX Tools the value 'creator', what is it used for?

Locked by User#19524

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
13
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

How it works

The creator value is a value that operates tracking KO's and WO's for the website, as well as the in-game leaderboard, if any. As you can see here, the Knockouts and Wipeouts statistics of your roblox profile is there.

When you insert a creator value into a player's humanoid.. then when they die the system checks for that tag, which is supposed to be an objectvalue - with the value of whatever player should get the KO. If there's that creator tag then it awards 1 KO to the value of the tag(supposedly being the player that killed you), as well as one WO to the victim that the tag is held in.

If say, there are multiple creator values inside of the Humanoid when they die then only the FIRST found child matching the requirements of a creator tag will be used - the first found just happens to be the last added as well(:


How to use it

Whenever whatever weapon you're using hits a player then you should create a 'creator tag' and place it into the player's character' Humanoid.

What your tag needs;

  • The tag must be an ObjectValue

  • The Value of the tag must be the player instance of whomever you're awarding the KO to

  • The tag must be placed in the Humanoid of your desired victim.

Example


--Sword script?

--Define your player
local plr = game.Players.LocalPlayer

--Whenever the handle touches someone
script.Parent.Handle.Touched:connect(function(hit)
    --Check to make sure it's a player
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
    if plr then
        --Create the tag, place it in their Humanoid
        local tag = Instance.new('ObjectValue',hit.Parent.Humanoid)
        tag.Name = 'creator'
        --Make the value your player instance
        tag.Value = plr
        --To be fair, make the tag expire.. so someone that you hit 10 minutes ago doesn't reward you a KO
        wait(3)
        tag:Destroy()
    end
end)
1
Please include an example of ROBLOX's implementation of dealing with the creator tag to detect KOs. You have not made it clear which creator tag is accepted as the KO; only the first creator tag is checked. Unclear 1776 — 9y
1
Also, you forgot to mention that it's the Leaderboard script that handles the kills and deaths in game! TurboFusion 1821 — 9y
Ad
Log in to vote
7
Answered by
Unclear 1776 Moderation Voter
9 years ago

the creator tag is ROBLOX's hacky way to detect KOs. It is an ObjectValue named "creator" with the Value property pointing to a player that is the killer.

Every time a player's humanoid's Died event triggers, ROBLOX checks if any creator tags exist within the humanoid, and if one does then it reads the Value property for a reference to a player. The player that is referenced is identified as the killer, and the killer gets one KO. The check is similar to the code below, assuming humanoid is a reference to the player's humanoid...

humanoid.Died:connect(function()
    local creator = humanoid:FindFirstChild("creator")
    if creator and creator.ClassName == "ObjectValue" then
        local killer = creator.Value
        -- add a KO
    end
end)