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: Simple script

Previous Thread :: Next Thread 
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:04 PM
Because I'm a lazy noob, could someone make a script for a gui that shakes it (rotates frequently back and forth), when you hover over it, and reset back to the original position when you stop hovering


Report Abuse
omegashawn123 is not online. omegashawn123
Joined: 27 Sep 2013
Total Posts: 269
02 Oct 2016 08:08 PM
wiki.roblox.com

is your friend
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:09 PM
i didnt ask for that.


Report Abuse
XCVlll is not online. XCVlll
Joined: 23 Oct 2008
Total Posts: 963
02 Oct 2016 08:09 PM
this isn't what this forum is meant for
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:10 PM
i know. i didnt ask what it was for


Report Abuse
iiEpixnesss is online. iiEpixnesss
Joined: 31 Mar 2012
Total Posts: 170
02 Oct 2016 08:19 PM
Look up TweenRotation on wiki.roblox.com
Report Abuse
skydude221 is not online. skydude221
Joined: 15 May 2013
Total Posts: 5014
02 Oct 2016 08:21 PM
wiki.roblox.com

is your best friend [2]


t(-.-t)
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:21 PM
It not that I don't know how to rotate, the issue is to keep it rotating back and forth while you're hovering, then having it reset to the original position when the mouse leaves.

The only real problem i have is to keep it going until your mouse leaves.


Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:22 PM
So again, your wiki responses are useless, as it's not a syntax error, it's a logic error.


Report Abuse
skydude221 is not online. skydude221
Joined: 15 May 2013
Total Posts: 5014
02 Oct 2016 08:23 PM
use while true do and a wait


t(-.-t)
Report Abuse
skydude221 is not online. skydude221
Joined: 15 May 2013
Total Posts: 5014
02 Oct 2016 08:24 PM
or when the mouse hovers over it then use a function to tween it


t(-.-t)
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:26 PM
Ill paste my script, one second.


Report Abuse
iiEpixnesss is online. iiEpixnesss
Joined: 31 Mar 2012
Total Posts: 170
02 Oct 2016 08:29 PM
Do you know how to even script a function? If not why are you jumping straight to gui movement??
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:30 PM
I'm not inept, I told you, it's a logic issue, not a syntax issue. I'll paste the script.


Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:32 PM
function AssaultHover()
while true do
for i = 1,5,1 do
wait()
script.Parent.Interface.ClassButtons.Assault.Rotation = script.Parent.Interface.ClassButtons.Assault.Rotation + 2
end
end
end


Assault.MouseEnter:connect(AssaultHover)


Obviously this only goes one direction, and doesn't ever stop even if you hover off of it, because i didn't script it to do that yet.

I just need to know, once it reaches a certain rotation value, it stops, and does the same thing the opposite direction, then resets back to the original position when stop hovering. I'd image i'd make a seperate function, but again, it's a logic issue.


Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 08:33 PM
The main issue is making it stop, then resetting.


Report Abuse
greedyawesomeman is not online. greedyawesomeman
Joined: 18 Apr 2010
Total Posts: 1038
02 Oct 2016 09:15 PM
.MouseEnter

blnHovering = true


.MouseLeave

blnHovering = false


while blnHovering do
wait()
--Shaking code here
end
Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 09:19 PM
Thanks, but i almost got it right. This is it so far.

--Variables
AssaultHoverValue = false
Assault = script.Parent.Interface.ClassButtons.Assault.Button


function AssaultHover()
wait()
if AssaultHoverValue == true then
while AssaultHoverValue == true do
wait()
script.Parent.Interface.ClassButtons.Assault.Rotation = script.Parent.Interface.ClassButtons.Assault.Rotation + 1
wait()
script.Parent.Interface.ClassButtons.Assault.Rotation = 0
wait()
script.Parent.Interface.ClassButtons.Assault.Rotation = script.Parent.Interface.ClassButtons.Assault.Rotation - 1
end
end
end

function TurnHoverOn()
AssaultHoverValue = true
end

function TurnHoverOff()
AssaultHoverValue = false
end

Assault.MouseEnter:connect(AssaultHover)
Assault.MouseEnter:connect(TurnHoverOn)
Assault.MouseLeave:connect(TurnHoverOff)


Sure it's painfully inefficient, but it almost works perfectly, just needs some tweaking


Report Abuse
StoryBased is online. StoryBased
Joined: 16 May 2012
Total Posts: 658
02 Oct 2016 09:20 PM
That's the first semi-working draft, anyways..


Report Abuse
greedyawesomeman is not online. greedyawesomeman
Joined: 18 Apr 2010
Total Posts: 1038
03 Oct 2016 10:21 PM
###################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
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