generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: quick question

Previous Thread :: Next Thread 
Thundeth is not online. 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
ArctaviosHellious is not online. ArctaviosHellious
Joined: 29 Mar 2014
Total Posts: 2048
01 May 2015 03:59 AM
O
Report Abuse
Thundeth is not online. Thundeth
Joined: 15 Mar 2015
Total Posts: 370
01 May 2015 04:03 AM
? explain pls?
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
01 May 2015 04:10 AM
Post the script.
Report Abuse
Thundeth is not online. 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 is not online. Thundeth
Joined: 15 Mar 2015
Total Posts: 370
01 May 2015 04:26 AM
bump
Report Abuse
Thundeth is not online. Thundeth
Joined: 15 Mar 2015
Total Posts: 370
01 May 2015 04:34 AM
bump
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
01 May 2015 04:37 AM
I dont think you can compare UDim2's.

if Bar.AbsoluteSize.X > 10 then
Report Abuse
Thundeth is not online. Thundeth
Joined: 15 Mar 2015
Total Posts: 370
01 May 2015 04:41 AM
didn't work.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image