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: Variable Change... Help

Previous Thread :: Next Thread 
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:36 PM
I been workin on a lil project lately and the way im tryna make it is making it hard... I need help, Say I use this to change a variable:

local ex = 1

wait(5)

ex = 2


Why wont it change the variable, or should I just make values?
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
04 Jul 2016 10:38 PM
uh what's the problem? that should change the variable as intended.


mom wheres the spaghetti | R$18,851
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
04 Jul 2016 10:38 PM
wat? it works
local ex = 1
print(ex)
wait(5)

ex = 2
print(ex)


Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
04 Jul 2016 10:38 PM
It works OP :)


"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:41 PM
Im tellin you, it is not workin... I can tell with the script i made
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
04 Jul 2016 10:41 PM
post the whole script


mom wheres the spaghetti | R$18,851
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:44 PM
player = game.Players.LocalPlayer
local shot = false
local barmove = false
local speed = .4
local makeit = false
local ShotPoint = Vector3.new(-110.87, 21.887, 57.45)
local MID = 80
local MIP = 500
local MD = 475
local MP = 500

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(170,0,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, false)
shot = true
end
while wait() do
wait (.3)
Bar.BackgroundColor3 = Color3.new(0,170,0)
makeit = true
print 'Wet On'
wait(.02)
Bar.BackgroundColor3 = Color3.new(170,0,0)
makeit = false
print 'Wet OFF'
end
while wait() do
if makeit == true then
ShotPoint = Vector3.new(-110.87, 21.887, 57.45)
bodyp.D = MID
bodyp.P = MIP
else
if makeit == false then
ShotPoint = Vector3.new(math.random(-100.87,-40), 21.887,math.random(0, 100.45))
bodyp.D = MD
bodyp.P = MP
end
end
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, true)
script.Parent.Parent = game.Workspace
wait()
local targetPos = ShotPoint
bodyp = Instance.new("BodyPosition", script.Parent.Handle)
bodyp.maxForce = Vector3.new(2000,2200,2000)
bodyp.D = MID
bodyp.P = MIP
bodyp.position = targetPos
print 'Shot'
shot = false
player.PlayerGui.ShotMeter:Destroy()
wait(1)
bodyp:Destroy()
end
end

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

script.Parent.Equipped:connect(selected)
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
04 Jul 2016 10:45 PM
what is the variable that isn't changing?


mom wheres the spaghetti | R$18,851
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
04 Jul 2016 10:46 PM
Well the problem is probably not a variable changing with that much going on...

Any errors OP?


"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:49 PM
MD. MP, MID, MIP is the variables that not changing and there are no errors at all, I know the variables not changing because when I go to test the bodyposition just stays the same....
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
04 Jul 2016 10:51 PM
Nowhere in the script do you try to set the variables. Did you want them to change? If so, what to?


"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:54 PM
MD. MP, MID, MIP is the variables that not changing and there are no errors at all, I know the variables not changing because when I go to test the bodyposition just stays the same....
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
04 Jul 2016 10:55 PM
I'm not sure how you just managed to post the exact same thing 6 minutes within each other.


"Tell me and I forget. Teach me and I remember. Involve me and I learn." - Benjamin Franklin
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 10:59 PM
Roblox is trash. thats how
Report Abuse
AlertedDynamite is not online. AlertedDynamite
Joined: 12 Jun 2015
Total Posts: 667
04 Jul 2016 11:03 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