Blockeus
|
  |
| Joined: 21 May 2012 |
| Total Posts: 297 |
|
|
| 26 Feb 2015 02:05 PM |
- Has Welding. - Variables - Instances
---- Other Stuff
- Take it if your beginner; if yer want:o (This is for localscript mate)
http://pastebin.com/hEwQjkcv
-- Check out the place; called ";" and take a COPY of it and play it to see what the script does:o It was for a game idea.
|
|
|
| Report Abuse |
|
|
Blockeus
|
  |
| Joined: 21 May 2012 |
| Total Posts: 297 |
|
|
| 26 Feb 2015 02:07 PM |
| Hope fully posting a Pastebin link to a script isn't; against roblox rules:l |
|
|
| Report Abuse |
|
|
Blockeus
|
  |
| Joined: 21 May 2012 |
| Total Posts: 297 |
|
|
| 26 Feb 2015 02:13 PM |
| If your cool with it plz, tell me. |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2015 02:24 PM |
-Not using local variables -Checking stuff more times than necessary -Not indented |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
Blockeus
|
  |
| Joined: 21 May 2012 |
| Total Posts: 297 |
|
|
| 26 Feb 2015 02:24 PM |
I know:P - I don't use local variables alot:o |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2015 02:34 PM |
-ALWAYS use local variables
-Instead of this: Mouse.KeyDown:connect(function(KeyValL) if (PlCheckSt) and (KeyValL == "c") and (Light.Enabled == false) then Light.Enabled = true elseif (PlCheckSt) and (KeyValL == "c") and (Light.Enabled == true) then Light.Enabled = false end end
Do this: Mouse.KeyDown:connect(function(KeyValL) if PlCheckSt and KeyValL == "c" then Light.Enabled = not Light.Enabled end end)
-Instead of this: --- for i = 1, #ClickDoor do if not (Door_Deb) and (ClickDoor[i] ~= nil) and (ClickDoor[i].ClassName == "BoolValue") and (ClickDoor[i].Name == "DoorStatus") and (ClickDoor[i].Value == true) and (User.Torso.Position - Mouse.Hit.p).magnitude <= 5 then Door_Deb = true ClickDoor[i].Parent.Parent.Door.Transparency = 0 ClickDoor[i].Parent.Parent.Door.CanCollide = true ClickDoor[i].Value = false ClickDoor[i].Parent.BrickColor = BrickColor.new("Dark green") ClickDoor[i].Parent.HighLight.Color = BrickColor.new("Dark green") ClickDoor[i].Parent.Light.Color = Color3.new(0,85,0) wait(2) Door_Deb = false elseif not (Door_Deb) and (ClickDoor[i] ~= nil) and (ClickDoor[i].ClassName == "BoolValue") and (ClickDoor[i].Name == "DoorStatus") and (ClickDoor[i].Value == false) and (User.Torso.Position - Mouse.Hit.p).magnitude <= 5 then Door_Deb = true ClickDoor[i].Parent.Parent.Door.Transparency = 1 ClickDoor[i].Parent.Parent.Door.CanCollide = false ClickDoor[i].Value = true ClickDoor[i].Parent.BrickColor = BrickColor.new("Bright red") ClickDoor[i].Parent.HighLight.Color = BrickColor.new("Bright red") ClickDoor[i].Parent.Light.Color = Color3.new(170,0,0) wait(2) Door_Deb = false end end ---
Do this: if (User.Torso.Position - Mouse.Hit.p).magnitude <= 5 then for i = 1, #ClickDoor do if not Door_Deb and ClickDoor[i] and ClickDoor[i]:IsA("BoolValue") and ClickDoor[i].Name == "DoorStatus" then Door_Deb = true if ClickDoor[i].Value then ClickDoor[i].Parent.Parent.Door.Transparency = 0 ClickDoor[i].Parent.Parent.Door.CanCollide = true ClickDoor[i].Parent.BrickColor = BrickColor.new("Dark green") ClickDoor[i].Parent.HighLight.Color = BrickColor.new("Dark green") ClickDoor[i].Parent.Light.Color = Color3.new(0,85,0) else ClickDoor[i].Parent.Parent.Door.Transparency = 1 ClickDoor[i].Parent.Parent.Door.CanCollide = false ClickDoor[i].Parent.BrickColor = BrickColor.new("Bright red") ClickDoor[i].Parent.HighLight.Color = BrickColor.new("Bright red") ClickDoor[i].Parent.Light.Color = Color3.new(170,0,0) end ClickDoor[i].Value = not ClickDoor[i].Value wait(2) Door_Deb = false end end end |
|
|
| Report Abuse |
|
|