|
| 04 Aug 2015 05:05 PM |
So, I'm making a like/dislike bar for my game, but, something is wrong here.
When I enter this code "script.Parent.LikeRatio.Bar.Size = UDim2.new((script.Parent.Likes.Value/script.Parent.Dislikes.Value), 0, 1, 0)", the likes/dislikes bar sometimes go off balance and in crazy distances off the GUI. How do I make it a ratio to 1 and keep it on the grid? |
|
|
| Report Abuse |
|
|
lokkut
|
  |
| Joined: 18 Mar 2009 |
| Total Posts: 1794 |
|
|
| 04 Aug 2015 05:05 PM |
(script.Parent.Likes.Value/script.Parent.Dislikes.Value)
should be
(script.Parent.Likes.Value/(script.Parent.Likes.Value+script.Parent.Dislikes.Value)) |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 04 Aug 2015 05:06 PM |
script.Parent.LikeRatio.Bar.Size = UDim2.new((script.Parent.Likes.Value/(script.Parent.Likes.Value + script.Parent.Dislikes.Value)), 0, 1, 0)
Since the value is scaled, you have to make it out of the total likes + dislikes while true do the do |
|
|
| Report Abuse |
|
|
| |
|