of     2   
chevron_rightchevron_rightchevron_right

FisherPenguin
#63450668Sunday, February 26, 2012 1:33 AM GMT

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. 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
miz656
#63450977Sunday, February 26, 2012 1:39 AM GMT

You used an anonymous function, so you don't have to say the connection line again, just say end)
FisherPenguin
#63452613Sunday, February 26, 2012 2:08 AM GMT

1) Where are you talking about? 2) Keep in mind that these are two different scripts in the same brick. Their not in one literal script, each one has it's own. +-Fishy
miz656
#63452688Sunday, February 26, 2012 2:09 AM GMT

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) You have two connection lines...When you have an anonymous function... No point of the second connection line.
FisherPenguin
#63453542Sunday, February 26, 2012 2:24 AM GMT

One, I am connecting when it is hit, the other is when it stops being hit. I don't think that that's the problem because the lowering script works perfectly, but when Part2 hits bottom, it wont go back up, so I think it's somewhere in either the raising script, or when I try to change the disabled. +-Fishy
miz656
#63454438Sunday, February 26, 2012 2:38 AM GMT

"the other is when it stops being hit." Why not use the TouchEnded event?
FisherPenguin
#63455191Sunday, February 26, 2012 2:50 AM GMT

Ummm... I do...? +-Fishy
FisherPenguin
#63455243Sunday, February 26, 2012 2:51 AM GMT

I use TouchEnded at the end of both... +-Fishy
FisherPenguin
#63456755Sunday, February 26, 2012 3:14 AM GMT

Anyone?
dave2011
#63456894Sunday, February 26, 2012 3:16 AM GMT

tl;dr couldnt you just make the brick lower by .6 or whatever every second or whatever
FisherPenguin
#63457923Sunday, February 26, 2012 3:31 AM GMT

Umm...I do do that. That part of the script works. It's not raising back up when it is at a certain position... +-Fishy
FisherPenguin
#63460145Sunday, February 26, 2012 4:05 AM GMT

Bawmp +-Fishy
FisherPenguin
#63461857Sunday, February 26, 2012 4:38 AM GMT

I'm still lost over here... +-Fishy
FisherPenguin
#63463844Sunday, February 26, 2012 5:17 AM GMT

Bawmper cartz +-Fishy
miz656
#63463880Sunday, February 26, 2012 5:18 AM GMT

Since you are desperate for help tell me the PART you think messes up. The script, post it.
FisherPenguin
#63488879Sunday, February 26, 2012 6:37 PM GMT

I think it's the raising script that breaks. I think it has something to do with the 's' and 't' variables too, I don't think I did those right. Maybe somewhere in this part? 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 +-Fishy
FisherPenguin
#63495732Sunday, February 26, 2012 8:21 PM GMT

???? +-Fishy
miz656
#63496218Sunday, February 26, 2012 8:30 PM GMT

Why do you have g as your arguement/
FisherPenguin
#63498480Sunday, February 26, 2012 9:07 PM GMT

That's not the problem... If it was, then why does it work in the lowering script? +-Fishy
miz656
#63499529Sunday, February 26, 2012 9:22 PM GMT

Bro if I were you I would just rewrite it because really, I don't know what's happening. I would have to see your game to fix this.
FisherPenguin
#63499791Sunday, February 26, 2012 9:26 PM GMT

Ok. I you want to see my place, then go to my last place called "Testing area". It's a flag(Part2) that is supposed to lower, change color, and raise again. But it all depends on who is touching it, and the color the brick is. +-Fishy
FisherPenguin
#63502552Sunday, February 26, 2012 10:08 PM GMT

Bawmp +-Fishy
miz656
#63505938Sunday, February 26, 2012 11:05 PM GMT

When I'm on the part it doesn't lower...It doesn't do anything.
FisherPenguin
#63506064Sunday, February 26, 2012 11:07 PM GMT

That's because your not in either of the two groups listed used in the script. +-Fishy
miz656
#63506268Sunday, February 26, 2012 11:10 PM GMT

-_- I would just rewrite it. Because I got no time to fix this and I don't think no one else is gonna help since this thread has been here for a while.

    of     2   
chevron_rightchevron_rightchevron_right