generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Will this script lag the game/cause issues?

Previous Thread :: Next Thread 
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 03:32 PM
Will this script lag the game since every single command monitors when a player enters?

--PERMISSIONS--
GroupId = 968384 --Your group ID here
GroupRank = 254
--MAP SETTINGS--
SF = game.ServerStorage.SwordFight
Formation = game.ServerStorage.Form
--SWORD FIGHT--
function SwordFight(message, player)
if message == "startsf" and player:IsInGroup(GroupId) and player:GetRankInGroup(GroupId) >= GroupRank and script.LevelExist.Value==false then
script.LevelExist.Value=true
SF.Parent=game.Workspace
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) SwordFight(message, player) end)
end)

--FORMATION--
function Form(message, player)
if message == "startform" and player:IsInGroup(GroupId) and player:GetRankInGroup(GroupId) >= GroupRank and script.LevelExist.Value==false then
script.LevelExist.Value=true
Formation.Parent=game.Workspace
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) Form(message, player) end)
end)

--STOP FUNCTION--
function Stop(message, player)
if message == "end" and player:IsInGroup(GroupId) and player:GetRankInGroup(GroupId) >= GroupRank and script.LevelExist.Value==true then
script.LevelExist.Value=false
end
end

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) Stop(message, player) end)
end)
Report Abuse
bohdan77 is not online. bohdan77
Joined: 10 Aug 2008
Total Posts: 7944
13 Oct 2013 05:00 PM
Amazing efficiency.
Report Abuse
Victimize is not online. Victimize
Joined: 09 Jun 2013
Total Posts: 1789
13 Oct 2013 05:20 PM
MY EYES
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 05:29 PM
Will you stop being rude? It's my first admin commands.
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 05:30 PM
Instead of being rude, why don't you shut up and show me something better and tell me how I can improve?
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
13 Oct 2013 06:14 PM
Someone poke it. Maybe it'll run faster.
Report Abuse
bohdan77 is not online. bohdan77
Joined: 10 Aug 2008
Total Posts: 7944
13 Oct 2013 06:16 PM
evildaddy, Advise, Look at freemodel admin commands. Learn from them, and never come back here. Go to Scripting Helpers.
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 06:22 PM
@Boh

If you criticize you better be able to show that you can do better. Also, I can see I posted in the wrong spot my apologies.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
13 Oct 2013 06:57 PM
Hold up, redoing this whole thing for you.
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
13 Oct 2013 07:04 PM
It's still not as efficient as it could be, not very dynamic, and I'm not sure how high your competence level for scripting is so it may be confusing, but its a heck of a lot better than before:

--PERMISSIONS--
GroupId = 968384 --Your group ID here
GroupRank = 254
--MAP SETTINGS--
SF = game.ServerStorage.SwordFight
Formation = game.ServerStorage.Form
--SWORD FIGHT--
local Commands = {

startsf = function() -- Removed unnecessary parameters
script.LevelExist.Value=true
SF.Parent=game.Workspace
end,

--FORMATION--
startform = function()
script.LevelExist.Value=true
Formation.Parent=game.Workspace
end,

--STOP FUNCTION--
["end"] = function() -- Had to do that because `end` is a keyword
script.LevelExist.Value=false
end,

}

game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(GroupId) and player:GetRankInGroup(GroupId) >= GroupRank and script.LevelExist.Value==true then
player.Chatted:connect(function(message)
for _,command in pairs(Commands) do
if message == command then
command(message,player) -- Notice that those commands will still get the message and player passed to them
end
end
end)
end
end)
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
13 Oct 2013 07:32 PM
'Instead of being rude, why don't you shut up and show me something better and tell me how I can improve?'

>'shut up'
>'tell me how I can improve'

Report Abuse
999kko is not online. 999kko
Joined: 05 May 2012
Total Posts: 235
13 Oct 2013 08:50 PM
Probably.
Report Abuse
999kko is not online. 999kko
Joined: 05 May 2012
Total Posts: 235
13 Oct 2013 08:54 PM
You might want to add a Anti-Laag script. I have one search 999kko you'll find it
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
13 Oct 2013 09:21 PM
Do what Bhodan said, and never come back here.
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 09:22 PM
@mh

Thanks, I'll see if I can.
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 09:23 PM
@Ab

Make me.
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
13 Oct 2013 09:25 PM
That's easier than you think with the click of a Report Button.
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
13 Oct 2013 09:26 PM
@theawe

I can tell your too lazy to come out with a good comeback.
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
13 Oct 2013 09:28 PM
I can tell you're too lazy to:
1) Learn how to spell correctly
2) Learn the concept of efficiency
3) Learn that this is the wrong forum section to post in
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
14 Oct 2013 09:36 AM
@Ab

Humans make mistakes. I don't have 2 use grmer it nawt scewl umad bro.
and for efficentaccyy i dont eunderstand wut usayingggg
Report Abuse
SCP087Project is not online. SCP087Project
Joined: 29 Sep 2013
Total Posts: 198
14 Oct 2013 09:49 AM
Get out.

I'm one of the nicer ones here, too. And if I'm saying that, that must mean the not-so-kind ones will be flaming you.

Learn the concept of efficiency, like the people above said. This is some of the most horrible code I've seen.

Now, get out, or Sorcus is going to relocate you to banland. PERMANENTLY.
Report Abuse
xXxkarlxXx is not online. xXxkarlxXx
Joined: 05 Feb 2009
Total Posts: 269
14 Oct 2013 09:58 AM
"Someone poke it. Maybe it'll run faster." --This is a keeper. LOL
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
14 Oct 2013 10:00 AM
Guys, I'm sorry. I know I've been a jerk. Go here for a gift: www.roblox.com/care
Report Abuse
SCP087Project is not online. SCP087Project
Joined: 29 Sep 2013
Total Posts: 198
14 Oct 2013 10:02 AM
No, these are more suitable for the situation:

http://www.roblox.com/unnamed-item?id=118311535
http://www.roblox.com/unnamed-item?id=120456189
Report Abuse
Evildaddy is not online. Evildaddy
Joined: 17 Apr 2010
Total Posts: 5142
14 Oct 2013 10:05 AM
Come on, rage more please. While you are having a fit, I'mma do something useful.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image