|
| 16 Dec 2014 12:44 PM |
| What is the text code to set the values of a string or number, to Nil? |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:49 PM |
| theres no need to set something to nil, really |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:51 PM |
well, what if i wanted something to constantly execute itself throughout the entire game, "a script" wouldnt i set this string value to a global table of nil?
|
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:51 PM |
If it is a string then, if it is a text then : .Text = '' if it is a string value (such as value StringValue) then : .Value = '' if it is a number value then : .Value = 0
'' Is nil. 0 is 0 it is impossible (as far as I know unless you are using variables) to set a number value to nil as "NumberValue"'s can only be set to numbers unless as I said you are using variables in which case you can set that to anything within the respective boundaries of LUA. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Dec 2014 12:52 PM |
@laurence
0 isn't nil "" isn't nil
the only thing equal to nil is nil |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 Dec 2014 12:54 PM |
script.Parent.Touched:connect(function(hit) h = hit.Parent:findFirstChild("Humanoid") if h ~= nil then --stuff end end)
non player part touches it, value is nil |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:57 PM |
@chim
that is in no way related to what the OP asked, lol |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:58 PM |
See this is why scripting is bs, why can't i set a number to a value of nil if i wanted it to allways be looked for? Im working on a leaderboard, want to have a "global stat table" and i want a certain number from the global stat table to effects certain "humanoids" Roblox character, "like health, runspeed, Damage, Visibility, Chance to dodge damage"
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 Dec 2014 12:59 PM |
| still makes the value nil... |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 12:59 PM |
im sorry but i have no idea what ur talking about
all i can say is ive never done
x = nil |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 Dec 2014 01:00 PM |
never done it but...
string = ""
string = nil |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:01 PM |
omg you people
print("" == nil, 0 == nil, false == nil, {} == nil) --> false false false false |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:03 PM |
| ok cuz from what i understand, If i made a string value = to nill, then technically i can make it reset itself to a different number under a certain cercumstance other numbers are, other numbers, For example, If i had "agility" and i leveled up, I want the value of the level to be set to nil and then if this nil value is detected, i want it to increase the humanoid movespeed based upon the level of the agility. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 Dec 2014 01:03 PM |
heres a nil value...
x = game:FindFirstChild("blip") print(x) |
|
|
| Report Abuse |
|
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 16 Dec 2014 01:06 PM |
| a value that isnt found, a nil value |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:08 PM |
function onXPChanged(player, xp, level, c, Strength, Agility) if xp.Value>=level.Value * 80 then xp.Value = xp.Value * 0 level.Value = level.Value + 1 c.Value = c.Value + 500 Strength.Value = Strength.Value + 1 Agility.Value = Agility.Value + 1 end end
this is what i have, I want to create another string value that is related to "these stats" that will modify the "players" movespeed according to teh number of the "Agility" so, is it possible that i can do this by setting the value to nil after all of this happens and re-triggering a continual event to check to see if your movespeed is based upon the level of your agility? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 16 Dec 2014 01:09 PM |
| Basically, your problem is that you have poor scripting logic/ethics/that other word people like to use |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:10 PM |
| @ chimmihc I was trying to explain your first example, however I am unsure of if we are working with variables or actual string values from outside of the script now. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:11 PM |
| I want this script to be universal, For it is the "leaderboard" so Do i make this script into the pool of the whole? as in, in the workspace, and under the table of the World? |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:12 PM |
xp.Value = xp.Value * 0
wtf |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:12 PM |
| @Swissmonk140 If it is a number it is not a string it is a number or int value, unless you are going to set the number variable to a text variable, but that can easily be done with tostring(). |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2014 01:15 PM |
| so how do i tostring to the global my stats table of each individual humanoid that joins the game and tag them with a specific name that can be called upon by any chat through global strings and effect others. |
|
|
| Report Abuse |
|
|