|
| 02 Sep 2012 01:33 PM |
According to Roblox's "genius" number handling system, 0.1 - 0.1 = -7.302e-008. Now, this is a problem BECAUSE: -It crashes scripts (such as the one I'm using 0.1 - 0.1 on now) -It's imprecise (I mean COME ON, everyone knows 0.1 - 0.1 is freaking 0!) -Did I mention it crashes scripts?
~Kierantech909 |
|
|
| Report Abuse |
|
|
cobalt10
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 7371 |
|
|
| 02 Sep 2012 01:46 PM |
I can't seem to replicate this problem. How are you encountering it? What script do you run that gives that as output? I'm running simple scripts that simply "print(0.1 - 0.1)" and "game.Workspace.IntValue.Value = 0.1 - 0.1" and they both repeatedly give me 0.
~ Ivegottogodosomething! |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2012 02:39 AM |
Well, first, I have to say, Tech Issues is by far is less troll-ridden and chaotic than Scripting Helpers. Anyway, here's the script:
local selected = false script.Parent.ClickDetector.MouseClick:connect(function(plr) if selected == false then selected = true local sb = Instance.new("SelectionBox") sb.Transparency = 0.9 sb.Color = BrickColor.new(plr.TeamColor.Color) sb.Parent = script.Parent sb.Adornee = script.Parent else if script.Parent:findFirstChild("SelectionBox") then local esb = script.Parent.SelectionBox if esb.Color ~= plr.TeamColor.Color and esb.Transparency > 0 then esb.Transparency = esb.Transparency - 0.1 end if esb.Color ~= plr.TeamColor.Color and esb.Transparency >= 1 then esb.Color = BrickColor.new(plr.TeamColor.Color) end --if esb.Color == plr.TeamColor.Color and esb.Transparency <= 0 then --local stc = plr.TeamColor.Color --for q,w in pairs(game.Teams:getChildren()) do --if w.TeamColor.Color == stc then --w.Score = w.Score + 1 --end --end --end if esb.Color == plr.TeamColor.Color and esb.Transparency < 1 then esb.Transparency = esb.Transparency + 0.1 end end end end)
I disabled the scoring part because it doesn't work anyway, and the script breaks because of the afore mentioned error in the roblox number handling system. There's nothing wrong with the script (apart from the few lines that are disabled, that have no effect on the math).
~Kierantech909
P.S. I'm planning to fix the scoring error after my cup of tea. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2012 10:37 AM |
I'm going to have to "bump" this, it seems.
"Bump."
~Kierantech909 |
|
|
| Report Abuse |
|
|
cobalt10
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 7371 |
|
|
| 03 Sep 2012 10:38 AM |
God, it's been so long since I've last scripted. Alright. Give me a moment.
~ Ivegottogodosomething! |
|
|
| Report Abuse |
|
|
cobalt10
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 7371 |
|
|
| 03 Sep 2012 10:47 AM |
Well, I see nothing inherently wrong with this. Then again, the last time I've looked at a script was when I went to England just about a year and some months ago - and I never quite learned how to use in pairs. Nevertheless, the actual number counting functions seem sound. Have you tried running the scripts on a different computer? And have you checked to ensure that the transparency wasn't already at some really weird number before the calculations? Maybe some other script is trying to control the values and screwing up this script? It'd be easier if I had your actual place so I wouldn't have to recreate it on the basis of this script - where I'm likely to leave something out.
~ Ivegottogodosomething! |
|
|
| Report Abuse |
|
|
sable44
|
  |
| Joined: 14 Dec 2009 |
| Total Posts: 834 |
|
|
| 03 Sep 2012 12:01 PM |
| I can't help you because I can not script. :/ |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2012 01:07 PM |
The transparency starts at 0.9, as the script should say. I tried it on different computers, same result...
~Kierantech909 |
|
|
| Report Abuse |
|
|
cobalt10
|
  |
| Joined: 21 Jul 2008 |
| Total Posts: 7371 |
|
|
| 03 Sep 2012 01:09 PM |
So 0.9 - 0.1 is giving you an absurdly large number as a result?
~ Ivegottogodosomething! |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2012 11:27 AM |
No, it eventually gets down to 0.1-0.1. It gives me an absurdly long negative number instead of 0.
~Kierantech909 |
|
|
| Report Abuse |
|
|
neongoo51
|
  |
| Joined: 12 May 2009 |
| Total Posts: 33061 |
|
|
| 04 Sep 2012 12:51 PM |
| If you moved something with your mouse to the position 0 on any axis, this weird glitch may happen. Try moving it with other tools. Other than that, I don't know how that happens. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2012 11:30 AM |
@neongoo51: This doesn't have anything to do with Vector3; it's a simple numbervalue. I have many maps withsomething at Vector3 0,0,0 and nothing adversely affects anything.
~Kierantech909 |
|
|
| Report Abuse |
|
|