Hey im getting a error everytime im using toString.
Error:
[ERROR] addons/Adda/lua/weapons/worldgun/shared.lua:124: attempt to call global 'toString' (a nil value)
1. OnValueChanged - addons/Adda/lua/weapons/worldgun/shared.lua:124
2. ValueChanged - lua/vgui/dnumslider.lua:199
3. OnValueChanged - lua/vgui/dnumslider.lua:41
4. SetValue - lua/vgui/dnumberscratch.lua:47
5. SetValue - lua/vgui/dnumslider.lua:125
6. TranslateValues - lua/vgui/dnumslider.lua:218
7. OnCursorMoved - lua/vgui/dslider.lua:120
8. unknown - lua/vgui/dslider.lua:45
[CODE]
SValue = DermaNumSlider:GetValue()
Seconds = SValue / 25
Minutes = Seconds * 60
Time = math.Round( Minutes )
TimeS = toString(Time)
PrepareTime:SetText("Prepare Time: "..TimeS.."min "..Seconds.."sec")[/CODE]
Hint: PrepareTime is a derma label
it's tostring, not toString. Case matters.
With what r0uge said-
[CODE]
SValue = DermaNumSlider:GetValue()
Seconds = SValue / 25
Minutes = Seconds * 60
Time = math.Round( Minutes )
TimeS = tostring(Time)
PrepareTime:SetText("Prepare Time: "..TimeS.."min "..Seconds.."sec")
[/CODE]
Also, make sure Seconds, Minutes, Time and TimeS are LOCAL to the script, they sound like common names and could be messed with by another addon.
Sorry, you need to Log In to post a reply to this thread.