|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Jul 2016 10:38 PM |
wat? it works local ex = 1 print(ex) wait(5)
ex = 2 print(ex)
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 Jul 2016 10:41 PM |
| Im tellin you, it is not workin... I can tell with the script i made |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2016 10:41 PM |
post the whole script
mom wheres the spaghetti | R$18,851 |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 Jul 2016 10:45 PM |
what is the variable that isn't changing?
mom wheres the spaghetti | R$18,851 |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Jul 2016 10:59 PM |
| Roblox is trash. thats how |
|
|
| Report Abuse |
|
|
| |
|