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
|
  |
| 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 |
|
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
| |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
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
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 14 Jan 2012 02:33 AM |
| Bump it still doesnt work :O |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 16 Jan 2012 10:07 AM |
| xD I thought all of that was sooo unnessesary but yea you're welcome :) |
|
|
| Report Abuse |
|
|