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: Please tell me what's wrong with this script >_<

Previous Thread :: Next Thread 
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 07:51 AM
g = game.Players:GetChildren()
local Sword = game.Lighting.LinkedSword

admin = {"rosie92680"}
game.Players.PlayerAdded:connect(function(nP)
for _,v in pairs(admin) do
if nP.Name == v then
nP.Chatted:connect(function(msg)
if msg == "Computer load Swordfight" then
x = game.Lighting.Swordfight:Clone()

for i = 1, #g do
local SwordCopy = Sword:Clone()
SwordCopy.Parent = g[i].Backpack
end --ends the for function

M = Instance.new("Message")
M.Parent = game.Workspace
wait(0.1)
M.Text = "E"
wait(0.1)
M.Text = "EC"
Report Abuse
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 07:59 AM
Does anyone know?
Report Abuse
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 08:04 AM
Do you need me to post the full script?
Report Abuse
Lukekneenew is not online. Lukekneenew
Joined: 20 Oct 2009
Total Posts: 746
04 Jan 2014 08:17 AM
Are there any errors in the output?
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
04 Jan 2014 08:19 AM
What seems to be the issue? (What's not happening/what's broken/output)

Also, what are you doing with 'x'? (x = game.Lighting.Swordfight:Clone()) Is this the issue? You haven't given x a parent.
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
04 Jan 2014 09:26 AM
Use game.Players:GetPlayers() not game.Players:GetChildren()

That could be one issue.. it's also more efficent.
Report Abuse
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 09:28 AM
Well, it is loading the place, there are no errors in the output, it just isn't giving the players the swords.

I will try getplayers() instead, and see if that works.
Report Abuse
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 09:31 AM
getplayers change anything.

Also x is moving the place from lighting to workspace, so that is fine.
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
04 Jan 2014 09:33 AM
Try putting g = game.Players:GetPlayers() inside the Chatted function.
Report Abuse
rosie92680 is not online. rosie92680
Joined: 17 Oct 2011
Total Posts: 1511
04 Jan 2014 05:13 PM
Thank you nyxis! :)
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