Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
|
| 01 May 2015 03:57 AM |
I keep getting this error with this script (There is far more to it but this is the error line) attempt to compare two userdata values
powerBar.Size > UDim2.new(0,10,0,0) |
|
|
| Report Abuse |
|
|
| |
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
| |
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
| |
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
|
| 01 May 2015 04:11 AM |
wait(1)
player = game.Players.LocalPlayer Mouse = player:GetMouse() powerLevel = player.PlayerGui.ScreenGui.PowerLevel powerBar = player.PlayerGui.ScreenGui.Frame.TextButton local powerCost = 0
function PressQ(key) if (key == "v") then check = player.Character:findFirstChild("Humanoid") if check and check.Health > 0 and script.Parent.Running9.Value == 0 and powerLevel.Value > powerCost and powerBar.Size > UDim2.new(0,10,0,0) then script.Parent.Running9.Value = 1 powerLevel.Value = powerLevel.Value - powerCost powerBar.Size = powerBar.Size - UDim2.new(0,0,0,powerCost*2) check.WalkSpeed = check.WalkSpeed + 100 check.Health = 1 check.MaxHealth = 1 wait(3) check.MaxHealth = 100 check.WalkSpeed = 16
wait(50) script.Parent.Running9.Value = 0 end end end
Mouse.KeyDown:connect(PressQ) |
|
|
| Report Abuse |
|
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
| |
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
| |
|
|
| 01 May 2015 04:37 AM |
I dont think you can compare UDim2's.
if Bar.AbsoluteSize.X > 10 then |
|
|
| Report Abuse |
|
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
| |
|
|
| 01 May 2015 04:51 AM |
powerCost and powerBar.Size.X.Offset > 10 then
Change Offset to Scale if comparing scale. I cannot remember which numbers are scale and which are offset lol. |
|
|
| Report Abuse |
|
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
|
| 01 May 2015 03:10 PM |
| @war didn't work, what you mean with what your saying? |
|
|
| Report Abuse |
|
|
Thundeth
|
  |
| Joined: 15 Mar 2015 |
| Total Posts: 370 |
|
|
| 01 May 2015 03:15 PM |
| Okay got it too work thx it was a Y INSTEAD of X |
|
|
| Report Abuse |
|
|