of     1   

MajorCrusader
#190870569Friday, June 10, 2016 1:59 PM GMT

Snippet so far on this random thing. Critique *anything* you want with suggested changes please. Mostly looking for criticism on style so this *should* be enough to go on. --// MajorCrusader --------------------> Services <-------------------- local Players = game:GetService("Players"); local Teams = game:GetService("Teams"); --------------------> Constants <-------------------- local MIN_RAIDERS = 3; local MIN_DEFENDERS = 4; local RAIDER_COLOR = Teams.Raiders.TeamColor; local DEFENDER_COLOR = Teams.Defenders.TeamColor; local TIME_TO_HOLD = 700; local RAID_LIMIT_TIME = 3600; --------------------> Objects <-------------------- local RaidSystem = {}; --------------------> Functions <-------------------- -- Recursively loop and disable all pointlights -- @param Userdata Parent the parent to iterate through function RaidSystem:DisableAllPointLights(Parent) for _, Child in pairs(Parent) do if Child:IsA("PointLight") then Child.Disabled = true end self:DisableAllPointLights(Child); end end -- Count players on a team -- @param BrickColor3 Color the color of the team to check for function RaidSystem:TeamCount(Color) local Count = 0; for _, Player in pairs(Players:GetPlayers()) do if Player.TeamColor == Color then Count = Count + 1; end end return Count; end function RaidSystem:ValidRaidCheck() local RaiderCount = self:TeamCount(RAIDER_COLOR); local DefenderCount = self:TeamCount(DEFENDER_COLOR); if RaiderCount >= MIN_RAIDERS and DefenderCount >= MIN_DEFENDERS then end end function RaidSystem:StartRaid() for _, Player in pairs(Players:GetPlayers()) do Player:LoadCharacter(); wait(); -- Prevent a little lag end end -- The main loop function RaidSystem:Main() while true do if self:ValidRaidCheck() then self:StartRaid(); end wait(1); end end --------------------> Main <-------------------- RaidSystem:Main();
Unclear
#190870604Friday, June 10, 2016 2:00 PM GMT

Quit using semicolons.
MajorCrusader
#190870614Friday, June 10, 2016 2:00 PM GMT

1. realize the error with no getchildren call oops 2. not done with documentation or anything in this itll be consistent
MajorCrusader
#190870644Friday, June 10, 2016 2:01 PM GMT

@Unclear I think they look pretty but okay I'll get rid of them.
Unclear
#190870719Friday, June 10, 2016 2:02 PM GMT

The best style is the default style for a language. That way nobody has to learn your style and you get maximum compatibility.
MajorCrusader
#190870811Friday, June 10, 2016 2:04 PM GMT

camelCase is default but PascalCase really grew on me (also SNAKE_CASE isn't proper I guess because there's no *real* constants in Lua). Can I keep using PascalCase
[rfa#hidefromsearch]
#190871780Friday, June 10, 2016 2:29 PM GMT

[rfa#hidefromsearch]

    of     1