Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Aug 2012 03:55 PM |
Hello everyone. I've recently been amusing myself by tearing apart some old style WIJ technology. However, I've come across an issue. Very sorry for massive code chunk, however, I'm basically trying to change the BackgroundColor3 of a GUI frame.
====================================== function check() if equiped==true then if player.PlayerGui:findFirstChild("GunGui") ~= nil then player.PlayerGui.GunGui.Back.Frame:TweenSize(UDim2.new(Charge.Value/MaxCharge,0,1,0),"In","Linear",0.1) if overheated == false then player.PlayerGui.GunGui.Back.Status.Text = Charge.Value.."%" player.PlayerGui.GunGui.Back.Frame.BackgroundColor3 = Color3.new(255, 255, 153) --sp.Name=ToolName.." | "..Charge.Value.."%" end end sp.Ammo.Value = Charge.Value end end
--Ugly, I hate corrotines, oh well :)
function recharge() while true do wait(cooldownTime) if down==false then --if equiped==true then if overheated == false then if Charge.Value>0 then Charge.Value=Charge.Value-2--+math.random(1, 3) --not needed imo check() end end --end end end end
thread=coroutine.create(recharge) assert(coroutine.resume(thread))
function onChargeChanged() if Charge.Value >= MaxCharge then Charge.Value = 100 overheated = true for i = 1, MaxCharge do wait(overheattime/MaxCharge) Charge.Value = Charge.Value - 1 if player.PlayerGui:findFirstChild("GunGui") ~= nil and equiped == true then player.PlayerGui.GunGui.Back.Status.Text = "Recharging" player.PlayerGui.GunGui.Back.Frame.BackgroundColor3 = Color3.new(256-255, 256-0, 256-0) --sp.Name=ToolName.." | "..Charge.Value.."%" end sp.Ammo.Value = Charge.Value check() if Charge.Value==0 then overheated = false if player.PlayerGui:findFirstChild("GunGui") ~= nil and equiped == true then player.PlayerGui.GunGui.Back.Status.Text = Charge.Value.."%" player.PlayerGui.GunGui.Back.Frame.BackgroundColor3 = Color3.new(255, 255, 153) --sp.Name=ToolName.." | "..Charge.Value.."%" end break end end overheated = false end
if Charge.Value <= 0 then Charge.Value = 0 if player.PlayerGui:findFirstChild("GunGui") ~= nil then player.PlayerGui.GunGui.Back.Status.Text = Charge.Value.."%" player.PlayerGui.GunGui.Back.Frame.BackgroundColor3 = Color3.new(255, 255, 153) --sp.Name=ToolName.." | "..Charge.Value.."%" end end
end sp.Ammo.Changed:connect(onChargeChanged) ======================================
Alright, so inside you can see 3 Color3.new(255,255,153)s. That will produce a Cool yellow color, however, whenever I fire the gun, it always snaps back to (1,1,103) which is almost a navy blue. I've checked everything inside of the script for a trace of (1,1,103), but I haven't found anything.
Can anyone give me a pointer on what it is that I am doing wrong? |
|
|
| Report Abuse |
|
Joalmo
|
  |
| Joined: 28 Jun 2009 |
| Total Posts: 1160 |
|
| |
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
Joalmo
|
  |
| Joined: 28 Jun 2009 |
| Total Posts: 1160 |
|
| |
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 17 Aug 2012 09:22 AM |
And I got many numbers and letters.
Sorry, I don't understand.. q-q |
|
|
| Report Abuse |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 17 Aug 2012 09:39 AM |
Gee, seems like a very simple error that I'm not understanding.
Granted you volunteer, but no one has the time to type an answer? |
|
|
| Report Abuse |
|