justn Posted May 11, 2014 Share Posted May 11, 2014 Hi, I have a problem with this script im making ( for jail break ).. well, the problem is that the gate doesn't move.. i would like if someone can help please thanks. gate1 = createObject(980, 3535.1999511719, -1804.6999511719, 28.39999961853, 0, 0, 270) gate2 = createObject(980, 3535.3000488281, -1815.5999755859, 28.39999961853, 0, 0, 270) addEventHandler("onClientMarkerHit",marker, function(hitElement,matchingDimension) if ( hitElement == localPlayer ) then if not isPedInVehicle(localPlayer) and isElementWithinMarker(localPlayer,marker) then guiSetVisible(JailBreak_Progress,true) timer1 = setTimer(function() guiProgressBarSetProgress(JailBreak_Progress,guiProgressBarGetProgress(JailBreak_Progress)+1) end,1000,0) timer2 = setTimer(moveGate,5000,1) timer3 = setTimer(label,1000,0) end end end) function moveGate() if ( guiProgressBarGetProgress(JailBreak_Progress) == 100 ) then moveObject(gate1, 2000, 3535.3000488281, -1815.5999755859, 20.39999961853) moveObject(gate2, 2000, 3535.3000488281, -1815.5999755859, 20.39999961853) setTimer(function() moveObject(gate1, 2000, 3535.1999511719, -1804.6999511719, 28.39999961853) moveObject(gate2, 2000, 3535.1999511719, -1804.6999511719, 28.39999961853) end,20000,1) end end Link to comment
JR10 Posted May 12, 2014 Share Posted May 12, 2014 If your progress bar's value from the start is 0, then it would need 100 seconds to be filled. moveGate will be called after 5 seconds, the progress bar wouldn't equal 100 by that time, that's why it doesn't work. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now