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: GUI Help

Previous Thread :: Next Thread 
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 01:55 AM
Im tryna make tweening stop while it is in the middle of tweening and it is not going well... Any Suggestions?I labeled the script for all the things that suppose to Stop and start the tweening...


player = game.Players.LocalPlayer
shot = false
barmove = false ---|Tween|---

function key1(key)
if (key=='e') then
local Meter = Instance.new("ScreenGui", player.PlayerGui)
Meter.Name = 'ShotMeter'
--|Background|--

local BG = Instance.new("Frame", Meter)
BG.Size = UDim2.new(0.01, 0, 0.3, 0)
BG.Position = UDim2.new(.15, 0 , .5, 0)
BG.BackgroundTransparency = .5

--|Bar|--

local Bar = Instance.new("Frame", BG)
Bar.Size = UDim2.new(1,0,0.05,0)
Bar.Position = UDim2.new(0, 0, 1, 0)
Bar.BackgroundColor3 = Color3.new(0,170,0)

---|Stop|---

local GreenLight = Instance.new("Frame", BG)
GreenLight.BackgroundColor3 = Color3.new(173,173,173)
GreenLight.BackgroundTransparency = .5
GreenLight.Position = UDim2.new(0,0,.2,0)
GreenLight.Size = UDim2.new(1, 0, 0.05, 0)

barmove = true ---|Tween|---

--|variable|--

local speed = .4

while wait() do
if barmove == true then ---|Tween|---
Bar:TweenPosition(UDim2.new(0, 0, 0, 0) , "In", "Quad", speed)
shot = true
end
end
end
end

function Key3(key)
if (key=="e") then
wait()
repeat wait() until shot == true
barmove = false ---|Tween|---
script.Parent.Parent = game.Workspace
wait()
local targetPos=Vector3.new(-110.87, 21.887, 57.45)
local bodyp = Instance.new("BodyPosition", script.Parent.Handle)
bodyp.maxForce = Vector3.new(2000,2200,2000)
bodyp.D = 100
bodyp.P = 250
bodyp.position = targetPos
print 'Shot'
shot = false
wait(1)
bodyp:Destroy()
player.PlayerGui.ShotMeter:Destroy()
end
end

function selected(mouse)
mouse.KeyUp:connect(Key3)
mouse.KeyDown:connect(key1)
end

script.Parent.Equipped:connect(selected)
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 02:04 AM
Bump
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 02:15 AM
Bump2
Report Abuse
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
02 Jul 2016 02:22 AM
there is a property for tweening that will allow it to be interrupted:

bool TweenPosition (
UDim2 endPosition,
EasingDirection easingDirection = Out,
EasingStyle easingStyle = Quad,
float time = 1,
bool override = false, -- this allows it to be interrupted if it's true
function(TweenStatus) callback = nil
)
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 02:25 AM
Do I look like I know how to read wiki bs
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 02:35 AM
player = game.Players.LocalPlayer
shot = false
barmove = false
speed = .4

function key1(key)
if (key=='e') then
local Meter = Instance.new("ScreenGui", player.PlayerGui)
Meter.Name = 'ShotMeter'
--|Background|--

local BG = Instance.new("Frame", Meter)
BG.Size = UDim2.new(0.01, 0, 0.3, 0)
BG.Position = UDim2.new(.15, 0 , .5, 0)
BG.BackgroundTransparency = .5

--|Bar|--

Bar = Instance.new("Frame", BG)
Bar.Size = UDim2.new(1,0,0.05,0)
Bar.Position = UDim2.new(0, 0, 1, 0)
Bar.BackgroundColor3 = Color3.new(0,170,0)

---|Stop|---

local GreenLight = Instance.new("Frame", BG)
GreenLight.BackgroundColor3 = Color3.new(173,173,173)
GreenLight.BackgroundTransparency = .5
GreenLight.Position = UDim2.new(0,0,.2,0)
GreenLight.Size = UDim2.new(1, 0, 0.05, 0)

barmove = true

--|variable|--



while wait() do
if barmove == true then
Bar:TweenPosition(UDim2.new(0, 0, 0, 0) , "In", "Quad", speed, true)
shot = true
end
end
end
end

function Key3(key)
if (key=="e") then
wait()
repeat wait() until shot == true
barmove = false
Bar:TweenPosition(UDim2.new(0, 0, 0, 0) , "In", "Quad", speed, false)
script.Parent.Parent = game.Workspace
wait()
local targetPos=Vector3.new(-110.87, 21.887, 57.45)
local bodyp = Instance.new("BodyPosition", script.Parent.Handle)
bodyp.maxForce = Vector3.new(2000,2200,2000)
bodyp.D = 100
bodyp.P = 250
bodyp.position = targetPos
print 'Shot'
shot = false
wait(1)
bodyp:Destroy()
player.PlayerGui.ShotMeter:Destroy()
end
end

function selected(mouse)
mouse.KeyUp:connect(Key3)
mouse.KeyDown:connect(key1)
end

script.Parent.Equipped:connect(selected)
Report Abuse
KAMIKAZEPOLO is not online. KAMIKAZEPOLO
Joined: 14 Mar 2012
Total Posts: 1049
02 Jul 2016 02:37 AM
literally change this one line:

Bar:TweenPosition(UDim2.new(0, 0, 0, 0) , "In", "Quad", speed, false)

to

Bar:TweenPosition(UDim2.new(0, 0, 0, 0) , "In", "Quad", speed, true)
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 02:46 AM
That just stops it fir a sec then keeps tweening it
Report Abuse
0Dan is not online. 0Dan
Joined: 22 Oct 2009
Total Posts: 2552
02 Jul 2016 02:49 AM
KeyDown is deprecated


local l={e={a={v={e=function()print("bye")end}}}} l.e.a.v.e()
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 03:06 AM
No its not.... My functions are working just fine.. I just need the bar to stop movin on keydown
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
02 Jul 2016 03:09 AM
You don't know what deprecated means AlertedDynamite
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 03:24 AM
Un usedful or deleted
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 03:31 AM
?
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
02 Jul 2016 03:48 AM
Boi
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