Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 08:36 PM |
local Ammoval = script.parent.Ammo.Value
local ammgui = script.Parent.Parent.Parent.PlayerGui.Gunstuff.AM
while true do
wait (0.05)
ammogui = Ammoval
end
everything is in place, I believe in the while true do I'm tagging the ammogui as the ammoval, It's supposed to change text of Ammogui to the value of ammoval.
Bleh, I'm confused, Assistance please? |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Aug 2012 08:37 PM |
ammogui is Nil, can't set a NumberValue to an Object Value.
gtg so I can't help More. |
|
|
| Report Abuse |
|
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
| |
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 08:38 PM |
ew, wait, I think I figured it out.
Needs to change text. |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:39 PM |
ammogui = tonumber(Ammoval.Text)
?
† KMXD † |
|
|
| Report Abuse |
|
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 08:40 PM |
| Knight, I'm a really basic scripter, I just started not to long ago, Err, What exactly does that mean? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:42 PM |
It would return the text into a number, but if it isn't a number it would be nil, so I would check if it could first, like:
if tonumber(Ammoval.Text) then
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:43 PM |
Makes string into numbers
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 08:47 PM |
I have no clue,
The script is supposed to take the value of ammoval and change the text of ammogui to the value of ammoval, I'm really confused at the moment. Any way you could plainly explain this? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:49 PM |
I think you just want to change the Gui's text to the value...
ammogui.Text = Ammoval
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:50 PM |
Oh sorry, derped it all.
Do:
local Ammoval = script.parent.Ammo.Value local ammogui = script.Parent.Parent.Parent.PlayerGui.Gunstuff.AM while true do wait (0.05) ammogui.Text = Ammoval end
Though using the .Changed event would be better.
† KMXD †
|
|
|
| Report Abuse |
|
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 08:52 PM |
What's the .Changed event?
And knight, that's basically what I have in the script at the moment, however, it's not working. This is all in a tool, In the other thread I mentioned the hierarchy change. Is it a problem with the tagging process? |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:53 PM |
You made a typo for the variable, and you weren't changing the actual text, but the instance itself, though I'm not sure why it wouldn't work.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 08:55 PM |
Try this just in case:
while wait(0.05) do script.Parent.Parent.Parent.PlayerGui.Gunstuff.AM.Text = script.parent.Ammo.Value end
† KMXD † |
|
|
| Report Abuse |
|
|
Anya1917
|
  |
| Joined: 17 Aug 2011 |
| Total Posts: 108 |
|
|
| 21 Aug 2012 09:00 PM |
That didn't work either. Something I forgot to mention, and I think might be the problem, It's a local script.
I don't see how that'd effect it though, From what I know the local script functions on the preson's computer rather then the roblox game.
Have no clue, I'm confused with this script. |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 09:01 PM |
while wait(0.05) do Game.Players.LocalPlayer.PlayerGui.Gunstuff.AM.Text = script.parent.Ammo.Value end
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 09:01 PM |
Wait use this one
while wait(0.05) do Game.Players.LocalPlayer.PlayerGui.Gunstuff.AM.Text = script.Parent.Ammo.Value end
Knight left a parent as parent not Parent...
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 09:04 PM |
That might have a been the problem, I must've missed it.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 21 Aug 2012 09:05 PM |
| Alright, Thanks a bunch guys. This helped a lot. |
|
|
| Report Abuse |
|
|