|
The first script is supposed to make Part2 lower when Part1 is touched, if the positions, and person touching are right, along with making sure it's enabled. The second one lowers it on the same conditions. It lowers, but it wont raise, and the output gives me nothing. The lowering script lowers by itself, and the raising script raises by itself, but when I try to enable/disable anything, the raising script wont work. Part2 also wont change color. Any help would be appreciated.
~~~~~~~~~~~~LOWERING SCRIPT~~~~~~~~~~~~~~~~
c = game.Workspace.Part2.BrickColor --Flag's color
p = game.Workspace.Part1 --Part1
f = p.Touched:connect(onTouched) --Part1 is touched
g = p.Touched:connect(onTouched) --Find who touched Part1
o = game.Workspace.Part2
s = p.LoweringScript.Disabled
t = p.RaisingScript.Disabled
local ispressing = false
if ispressing == false and ispressing ~= nil then --If ispressing is equal to false and it equals something then...
game.Workspace.Part1.Touched:connect(function(hit) --...when it's touched...
ispressing = true --...it is being pressed.
end)
end
script.Parent.Touched:connect(hit)
local t = true
if t == true and o.Position.Y >= 14 and o.Position.Y <= 15 then
t = false
else
t = true
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(206262) then
if o.Position.Y >= 10 and o.Position.Y <= 57 then --...if the person who's touching it is in (enemy group # goes in parenthesis) then...
end --...do nothing.
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
while ispressing == true do --...while allie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is between 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 1.6 studs...
end
wait(.6)
end
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)--You made player global before, so you can't use the same thing.
if player:IsInGroup(206262) then
while ispressing == true do --...while enemie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is inbetween 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 5 studs...
end
wait(.6)
end
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
end --...do nothing.
end
end)
end
script.Parent.TouchEnded:connect(function()
if ispressing == true then
ispressing = false
end
end)
game.Workspace.Part1.Touched:connect()
~~~~~~~~~~~~~~RAISING SCRIPT~~~~~~~~~~~~~~~~~~~~
c = game.Workspace.Part2.BrickColor --Flag's color
p = game.Workspace.Part1 --Part1
f = p.Touched:connect(onTouched) --Part1 is touched
g = p.Touched:connect(onTouched) --Find who touched Part1
o = game.Workspace.Part2
s = p.LoweringScript.Disabled
t = p.RaisingScript.Disabled
local ispressing = false
if ispressing == false and ispressing ~= nil then --If ispressing is equal to false and it equals something then...
game.Workspace.Part1.Touched:connect(function(hit) --...when it's touched...
ispressing = true --...it is being pressed.
end)
end
script.Parent.Touched:connect(hit)
local s = false
if s == false and o.Position.Y >= 14 and o.Position.Y <= 15 then
s = true
else
s = false
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(206262) then
if o.Position.Y >= 10 and o.Position.Y <= 57 then --...if the person who's touching it is in (enemy group # goes in parenthesis) then...
end --...do nothing.
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
while ispressing == true do --...while allie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is between 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 1.6 studs...
end
wait(.6)
end
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)--You made player global before, so you can't use the same thing.
if player:IsInGroup(206262) then
while ispressing == true do --...while enemie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is inbetween 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 5 studs...
end
wait(.6)
end
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
end --...do nothing.
end
end)
end
script.Parent.TouchEnded:connect(function()
if ispressing == true then
ispressing = false
end
end)
game.Workspace.Part1.Touched:connect()
+-Fishy |
|
|
Sorry, here's the right version.
~~~~~~~~~~~~LOWERING SCRIPT~~~~~~~~~~~~~~~~
c = game.Workspace.Part2.BrickColor --Flag's color
p = game.Workspace.Part1 --Part1
f = p.Touched:connect(onTouched) --Part1 is touched
g = p.Touched:connect(onTouched) --Find who touched Part1
o = game.Workspace.Part2
s = p.LoweringScript.Disabled
t = p.RaisingScript.Disabled
local ispressing = false
if ispressing == false and ispressing ~= nil then --If ispressing is equal to false and it equals something then...
game.Workspace.Part1.Touched:connect(function(hit) --...when it's touched...
ispressing = true --...it is being pressed.
end)
end
script.Parent.Touched:connect(hit)
local t = true
if t == true and o.Position.Y >= 14 and o.Position.Y <= 15 then
t = false
else
t = true
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(206262) then
if o.Position.Y >= 10 and o.Position.Y <= 57 then --...if the person who's touching it is in (enemy group # goes in parenthesis) then...
end --...do nothing.
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
while ispressing == true do --...while allie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is between 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 1.6 studs...
end
wait(.6)
end
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)--You made player global before, so you can't use the same thing.
if player:IsInGroup(206262) then
while ispressing == true do --...while enemie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is inbetween 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, -1.6, 0) --...move Part2 down 5 studs...
end
wait(.6)
end
end
end
end)
end
if t == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
end --...do nothing.
end
end)
end
script.Parent.TouchEnded:connect(function()
if ispressing == true then
ispressing = false
end
end)
game.Workspace.Part1.Touched:connect()
~~~~~~~~~~~~~~RAISING SCRIPT~~~~~~~~~~~~~~~~~~~~
c = game.Workspace.Part2.BrickColor --Flag's color
p = game.Workspace.Part1 --Part1
f = p.Touched:connect(onTouched) --Part1 is touched
g = p.Touched:connect(onTouched) --Find who touched Part1
o = game.Workspace.Part2
s = p.LoweringScript.Disabled
t = p.RaisingScript.Disabled
local ispressing = false
if ispressing == false and ispressing ~= nil then --If ispressing is equal to false and it equals something then...
game.Workspace.Part1.Touched:connect(function(hit) --...when it's touched...
ispressing = true --...it is being pressed.
end)
end
script.Parent.Touched:connect(hit)
local s = false
if s == false and o.Position.Y >= 14 and o.Position.Y <= 15 then
s = true
else
s = false
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(206262) then
if o.Position.Y >= 10 and o.Position.Y <= 57 then --...if the person who's touching it is in (enemy group # goes in parenthesis) then...
end --...do nothing.
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Bright red")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
while ispressing == true do --...while allie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is between 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, 1.6, 0) --...move Part2 down 1.6 studs...
end
wait(.6)
end
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)--You made player global before, so you can't use the same thing.
if player:IsInGroup(206262) then
while ispressing == true do --...while enemie(s) is/are pressing the brick...
if o.Position.Y >= 16 and o.Position.Y <= 57 then --...and if Part2's "Y" position is inbetween 16 and 56 then...
o.CFrame = o.CFrame + Vector3.new(0, 1.6, 0) --...move Part2 down 5 studs...
end
wait(.6)
end
end
end
end)
end
if s == true then
p.Touched:connect(function(g)
if c == (BrickColor.new("Navy blue")) and g.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(g.Parent)
if player:IsInGroup(225681) then
end --...do nothing.
end
end)
end
script.Parent.TouchEnded:connect(function()
if ispressing == true then
ispressing = false
end
end)
game.Workspace.Part1.Touched:connect()
+-Fishy |
|
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
You hardly described the problem, so the fix is not simple at all, as I would need to go through your mess of code and look for small details. Not happening.
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
Dude, don't double post. I said I'll help you fix it BUT NO!!! You want others to fix it... Ah well. |
|
|
@Miz. When I posted this, my other one went on to the second page, and I didn't feel like bumping it, so I decided to start a new thread so it didn't have two pages. After I posted this, I saw that you had replied on my other one, which brought it back to the first page. Not my fault.
+-Fishy
|
|
|
And I'll give you a model without the group ID's in it, and you can try to fix it. 1 sec let me make it.
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
Ok, so, since this is a new thread tell me what part you think is not working :P |
|
|
Well, here's a link to the model of it that you ask for in the other script. I gtg for now sooo have fun with it :P
http://www.roblox.com/Flag-Unworking-item?id=73493349
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
Now where did I say IN THIS THREAD I'll fix it for you :O? |
|
|
You didn't, but I say I'm doing you a favor because you don't have to click onto a second page :P
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
-_-
It doesn't take me that long to move my mouse and click a number 2 at the bottom... |
|
|
Yeah I know. But it's easier to just check one thread, instead of two, right?
+-Fiahy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
No...Because that was a popular thread. So I could of posted right away instead of now... |
|
|
Well...Now this is becoming close to a popular one sooo...It makes no difference now, so let's stop arguing about something stupid :P
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
Differences is I can't help you because I asked to help you in the LAST THREAD. But you said that one was dead so now I'm not sure if you want help. |
|
|
I didn't say it was dead...I just thought it would be easier this way...sorry I guess...
+-Fishy |
|
|
Also, I wasn't trying to offend you by making a new thread. I wasn't trying to get other help because you couldn't do it. I believe that you can, I just thought a shorter forum would be easier.
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
Dude, I was seriously about to fix this. I asked you to make a model. But NO, you didn't want my help anymore. The only reason I couldn't fix it is because I don't know what's going on 100%. But if I had a model I would of. |
|
|
I made a model for you...And I had to go yesterday because my mom was yelling at me to get off the computer...
+-Fishy |
|
|
Here's the link to the model again.
http://www.roblox.com/Flag-Unworking-item?id=73493349
Problems:
The lowering script, and the raising script both work by themselves, until I try to disable the raising script, and then enable it when Part2(The flag), is at a certain position. The problem is, when part2(The flag), gets to that position, then it doesn't change color, or go back up. And it all depends on who is touching the base(Part1).
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
When did I say I'll fix it IN THIS FORUM ? |
|
|
I guess you didn't. If you want to move back to the other thread, then I tracked it so we can...
+-Fishy |
|
miz656Join Date: 2010-07-19 Post Count: 15336 |
That thread is dead to me now. |
|
|
Ok. What do we do from here?
+-Fishy |
|