Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

oTrying to rotate my Image Button to make a refresh image (GUI)?

Asked by
o_Khoi 4
5 years ago
Edited 5 years ago

Hello. I've been recently trying to rotate my gui to make a refresh image, but even with the help of the internet I cannot find out how to do it. I've looked at several scripts :

while true do --Create a loop so it doesn't stop.
    wait(1) --Keep this here or else the script will lag.
script.Parent.Rotation = script.Parent.Rotation +.5 --Put this higher to increase the speed!
end 

But it doesn't work anymore, can someone help me?

0
I'd suggest changing lines 1 and 2 into "while wait() do" for 2 reasons. 1. Your loop is very simple, 2. if you leave wait() blank, then it'll make a 1/30th of a second. Most animation is animated at 30 fps (1/30th a second)! EzraNehemiah_TF2 3552 — 5y

2 answers

Log in to vote
0
Answered by
yellp1 193
5 years ago

You can keep the code how it is (although it's not very efficient) but you because this gui eventually gets replicated to the player, it needs to be put in a local script and not a server script

Ad
Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Hello, o_Khoi!

This script should work, just what you need to do is use a Local Script and place it as a children of the frame

Hope this helps

Good Luck with your games

Answer this question