generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Possible to Set values to Nil?

Previous Thread :: Next Thread 
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
16 Dec 2014 12:44 PM
What is the text code to set the values of a string or number, to Nil?
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
16 Dec 2014 12:49 PM
theres no need to set something to nil, really
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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
laurence122 is not online. laurence122
Joined: 17 Sep 2011
Total Posts: 135
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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
16 Dec 2014 12:51 PM
wot
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
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 is not online. 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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
16 Dec 2014 12:57 PM
@chim

that is in no way related to what the OP asked, lol
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
16 Dec 2014 12:59 PM
still makes the value nil...
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
16 Dec 2014 01:00 PM
never done it but...

string = ""

string = nil
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
16 Dec 2014 01:01 PM
omg you people

print("" == nil, 0 == nil, false == nil, {} == nil) --> false false false false
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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 is not online. 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
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
16 Dec 2014 01:05 PM
So what is "blip" ?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
16 Dec 2014 01:06 PM
Nil
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
16 Dec 2014 01:06 PM
a value that isnt found, a nil value
Report Abuse
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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 is not online. 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
laurence122 is not online. laurence122
Joined: 17 Sep 2011
Total Posts: 135
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
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
16 Dec 2014 01:12 PM
xp.Value = xp.Value * 0

wtf
Report Abuse
laurence122 is not online. laurence122
Joined: 17 Sep 2011
Total Posts: 135
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
swissmonk140 is not online. swissmonk140
Joined: 21 Jan 2008
Total Posts: 187
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image