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 » Scripting Helpers
Home Search
 

Re: How Many Ends and )s Do I Need?

Previous Thread :: Next Thread 
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 02:23 PM
How many ends and )'s do I need in this script? Also will this script work? If not what do I need to do to fix it?


game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == ":Dominus me" or ":DOMINUS ME" or ":dominus me" then
for i, v in pairs(plrz) do

if v and v.Character then
local obj = game:service("InsertService"):LoadAsset(31101391)
for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = v.Character end end
obj:Destroy()



Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
05 Feb 2014 02:24 PM
I suggest you rewrite it with Falcon Scripting Plugin, it will automatically do this.
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 02:51 PM
Uhhhhh what?
Report Abuse
iYoshiFox is not online. iYoshiFox
Joined: 14 Apr 2012
Total Posts: 1058
05 Feb 2014 02:52 PM
end
end
end
end
end)
end)


--Put dat at the end o3o
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 03:17 PM
Nope. It says ')' expected (to close '(' at line 2) near 'end' on line 15.


game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == ":Dominus me" or ":DOMINUS ME" or ":dominus me" then
for i, v in pairs(plrz) do

if v and v.Character then
local obj = game:service("InsertService"):LoadAsset(31101391)
for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = v.Character end end
obj:Destroy()

end
end
end
end
end)
end)
Report Abuse
MarioKartAddict is not online. MarioKartAddict
Joined: 11 Nov 2009
Total Posts: 42774
05 Feb 2014 03:18 PM
end
end
end
end
end)
end)
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Feb 2014 03:43 PM
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == ":Dominus me" or ":DOMINUS ME" or ":dominus me" then
for i, v in pairs(plrz) do
if v and v.Character then
local obj = game:service("InsertService"):LoadAsset(31101391)
for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = v.Character end end
obj:Destroy()
end
end
end
end)
end)
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
05 Feb 2014 03:45 PM
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower() == ":dominus me" then
for i, v in pairs(plrz) do
if v and v.Character then
local obj = game:service("InsertService"):LoadAsset(31101391)
for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = v.Character end end
obj:Destroy()
end
end
end
end)
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
05 Feb 2014 03:46 PM
Anyone who doesn't know what they're doing please stop posting; mine works fine and has the proper end amount.
Report Abuse
catsplz is not online. catsplz
Joined: 08 Sep 2011
Total Posts: 17789
05 Feb 2014 03:48 PM
im sort of a noob to scripting but
isnt
"plrz" supposed to be "plrs" or am i just insane
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
05 Feb 2014 03:49 PM
Oops I'm missing a final 'end)' at the end, sorry!

azu out
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
05 Feb 2014 04:16 PM
All you have to keep in mind is: "everything that is opened must be closed" yes, this includes parenthesis, brackets, braces, quotes (single and double), statements, pretty much everything.
Report Abuse
BlockBones2 is not online. BlockBones2
Joined: 19 Oct 2008
Total Posts: 404
05 Feb 2014 04:18 PM
Most things that need an end will be opened with an |> arrow on the left side of the script.
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 04:42 PM
@Azureous

Your's did not work.
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 04:44 PM
Alright nothing's working. I must be doing something else wrong. Anyone know what I have to fix?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Feb 2014 04:46 PM
It's 6 ends with the last 2 closing parenthesis. I think.

#nerdsunited
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Feb 2014 04:46 PM
4*

#nerdsunited
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 06:30 PM
I don't think the ends or the )'s are the problem...
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
05 Feb 2014 06:31 PM
end end end end end) end)
Report Abuse
BlackBucketBoy is not online. BlackBucketBoy
Joined: 22 Jul 2011
Total Posts: 3230
05 Feb 2014 06:33 PM
You never defined 'plrz'.
Report Abuse
catsplz is not online. catsplz
Joined: 08 Sep 2011
Total Posts: 17789
05 Feb 2014 06:40 PM
^
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 07:01 PM
How would I do that?
Report Abuse
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
05 Feb 2014 07:05 PM
Rower#


Not entirely sure how to help you here, but I did spot one thing that might help you.

if msg == ":Dominus me" or ":DOMINUS ME" or ":dominus me" then

Make it


if msg:lower() == ":dominus me"


That way, you don't need to add so many 'or's, and it will work for whatever.
Report Abuse
rowerowe71 is not online. rowerowe71
Joined: 14 Apr 2013
Total Posts: 1999
05 Feb 2014 07:07 PM
Yeah that would help. Thanks..... But the script still doesn't work!!!


*Rage mode*
Report Abuse
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
05 Feb 2014 07:12 PM
PlayerList = game.Players:GetChildren()

game.Players.PlayerAdded:connect(function(plyr)
plyr.Chatted:connect(function(msg)
if msg:lower() == ":dominus me" then

for i, player in pairs(PlayerList) do
if v and v.Character then
local obj = game:service("InsertService"):LoadAsset(31101391)
for a, hat in pairs(obj:GetChildren()) do
if hat:IsA("Hat") then hat.Parent = v.Character
end end end end end
obj:Destroy()
end)
end)

This should work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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