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 » Scripting Helpers
Home Search
 

Re: How come I can change values in Play Solo and NOT online!?

Previous Thread :: Next Thread 
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
08 Jan 2012 09:50 AM
Well I have a script in which I change a NumberValue in a eat/drink script (it updates your hunger and thirst when you eat something).

EVERYTHING works in it. Gui updates work, destroyed when eaten work...

But one thing doesnt. The values ain't updated! In play solo I can update them, everything works, when I publish and play it it suddenly doesnt!?

I only am going to post where the problem is in, the block with the clicked event:

function Clicked(mouse)
if mouse.Target ~= nil then
if mouse.Target ~= not nil then
local EDIBLE = mouse.Target:FindFirstChild("Edible")
if EDIBLE == nil then
else
local head = name_player.Character.Head
local part = EDIBLE.Parent
local distanceToFood = (head.Position - part.Position).magnitude
if distanceToFood < EatDrinkRange then
local hunger_upgrade = EDIBLE.Hunger.Value
local thirst_upgrade = EDIBLE.Thirst.Value
local health_upgrade = EDIBLE.Health.Value
local lungs_upgrade = EDIBLE.Lungs.Value
local hunger_message = stats.HungerNew.Value + (hunger_upgrade)
local thirst_message = stats.ThirstNew.Value + (thirst_upgrade)
local lungs_message = stats.LungsNew.Value + (lungs_upgrade)
local health_message = stats.HealthNew.Value + (health_upgrade)
script.Parent.Parent.Parent.Stats.HungerNew.Value = hunger_message
script.Parent.Parent.Parent.Stats.ThirstNew.Value = thirst_message
script.Parent.Parent.Parent.Stats.HealthNew.Value = health_message
script.Parent.Parent.Parent.Stats.LungsNew.Value = lungs_message
mouse.Target:Destroy()
end
end
end
end
end

TOOL.Selected:connect(onSelected)
TOOL.Deselected:connect(onDeselected)



As you can see when clicked I got LOTS of variables, this is to debug because I tried if it works like this.
Also, all values are defined ;)

NO output on solo, but it fully works there :O
And online i cant see it. ON every mode this script does something else.

Someone, help?

Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
08 Jan 2012 10:03 AM
If you cant fix it, maybe there is a way to see output in server mode?

Also, if I Start Server and then Start Player the script is also doing strange - but other than doing in Play Solo or in Online server... *sigh*
Report Abuse
lightwolf69 is not online. lightwolf69
Joined: 11 Jun 2011
Total Posts: 5592
08 Jan 2012 10:05 AM
UMadBro?
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
08 Jan 2012 10:09 AM
!?
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
08 Jan 2012 11:06 AM
bump
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
09 Jan 2012 09:41 AM
bump
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
09 Jan 2012 10:12 AM
Sorry that I can't take a look at it now but you can see your output with this model by Roblox: http://www.roblox.com/Server-Error-Monitoring-System-item?id=65774258

Also try adding a wait(1) at the start.

[I need to learn an Algorithm to deal with noobs.]
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
09 Jan 2012 12:08 PM
Thank you very much! Ill try it out very soon, will post the outcome here.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
09 Jan 2012 02:00 PM
No output.

I did something new, I putted messages in there to use as print() in server.

It looks like the values aint added. I found the root of the problem. Now my question is this.

How to make this:
You got a value (e.g. 80) and you want to add anothervalue (like 10). How do u script that?

like this?
value.Value = value.Value + 10
??

Because that wont work!
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
09 Jan 2012 02:15 PM
yea...
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
09 Jan 2012 02:16 PM
bump
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
09 Jan 2012 02:17 PM
YES!!!-.-
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
09 Jan 2012 02:17 PM
Oops sorry!

Well, it wont work :O I checked it out, they dont add! Its very very very strange, even I don't know how to fix this!

Value modding just works, other scripts also work in my game, they also use value modding.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
14 Jan 2012 02:33 AM
Bump it still doesnt work :O
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
14 Jan 2012 03:08 AM
if adding dont work then just use

local x=value.Value
local v= Instance.new("IntValue",value.Parent).Value=x+10
v.Name=value.Name
value:remove()

but I dont think you will need to do that .. just if you really couldn't figure it out you may use it as an alternative way to do +10 xD
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
14 Jan 2012 08:51 AM
I'll try that.

The +10 is not a good idea, because we use different values for everything.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
15 Jan 2012 05:42 AM
DragonFang! You are my hero, so much thanks! It finally works! Thank you SOOO much!
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
16 Jan 2012 10:07 AM
xD I thought all of that was sooo unnessesary but yea you're welcome :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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