clanky4
|
  |
| Joined: 21 Oct 2009 |
| Total Posts: 389 |
|
|
| 23 Jun 2013 08:49 PM |
I am trying to make a script that will change the scale/size of a gui. Everything works fine until line 17 where it says that scale cannot be assigned. Here is the output:
0.966000021 never mind charlie 0.966000020504 21:46:05.703 - Scale cannot be assigned to 21:46:05.718 - Script "Players.Player1.PlayerGui.playerhud.healthoutline.health di", Line 17 21:46:05.718 - stack end
And here is the script:
while true do wait()
local playername = script.Parent.Parent.Parent.Parent local maxnumber = script.Parent.Healthgui.maxnumber.Value local playerhealth = script.Parent.Health.Value local playerhealthmax = script.Parent.MaxHealth.Value
--Time for some math! local healthpercent = playerhealth / playerhealthmax local healthbar = maxnumber * healthpercent
print(healthbar) print("never mind charlie") print(script.Parent.Healthgui.Size.X.Scale)
script.Parent.Healthgui.Size.X.Scale = healthbar
end |
|
|
| Report Abuse |
|
|
clanky4
|
  |
| Joined: 21 Oct 2009 |
| Total Posts: 389 |
|
|
| 23 Jun 2013 09:26 PM |
| is it even possible to resize a gui with a script? |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 09:33 PM |
http://wiki.roblox.com/index.php/ScreenGui
Try reading that, I am not aware of resize of a Gui. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 09:38 PM |
Gui.Size = UDim2.new(X-Scale,X-Offset,Y-Scale,Y-Offset) Example: Gui.Size = UDim2.new(0.2,0,0.22,0) |
|
|
| Report Abuse |
|
|
clanky4
|
  |
| Joined: 21 Oct 2009 |
| Total Posts: 389 |
|
|
| 23 Jun 2013 09:50 PM |
So I needed a weird UDim2.new before the numbers.
Thanks guys! its works fine now :D |
|
|
| Report Abuse |
|
|