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: This isn't working?

Previous Thread :: Next Thread 
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:23 PM
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
player.Character:FindFirstChild("Humanoid").Died:connect(function()
if player.Class.Value == "Pusher" then
game.ServerStorage.Terraformer:Clone().Parent = player.Backpack
elseif player.Class.Value == "Guard" then
game.ServerStorage.Sword:Clone().Parent = player.Backpack
end
end)
end)
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
08 Mar 2015 01:27 PM
Well, in order to end a repeat loop you need until.


repeat

code here


until


http://wiki.roblox.com/index.php?title=Loops#Repeat
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
08 Mar 2015 01:28 PM
Wait, nevermind. Scratch that. I read it wrong.

I'll look into it, I don't see an error. Is the console clean?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:29 PM
I'm making sure the character exists, not waiting till a value reaches something.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:30 PM
Ninja'd.


And no, there's no output at all.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
08 Mar 2015 01:31 PM
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
player.Character:FindFirstChild("Humanoid").Died:connect(function()
if player.Class.Value == "Pusher" then
game.ServerStorage.Terraformer:Clone()
:Clone().Parent = player.Backpack
elseif player.Class.Value == "Guard" then
game.ServerStorage.Sword:Clone()
:Clone().parent = player.Backpack
end
end)
end)
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:33 PM
Isn't that exactly what I put? It's not working.
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
08 Mar 2015 01:38 PM
Well I changed the game.ServerStorage.Sword:Clone().Parent = player.Backpack

game.ServerStorgage.Sword:Clone()
:Clone().Parent = player.Backpack


I did the same thing how you did it on my holo I was scripting, it wouldn't load a map, so I used two separate lines to clone it from ServerStorage and move the clone to a new parent.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:38 PM
It works the exact same either way.
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
08 Mar 2015 01:41 PM
> game.ServerStorgage.Sword:Clone()
> :Clone().Parent = player.Backpack

Where did you get the idea that this makes any logical sense at all?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:42 PM
Can you help me figure out what the problem is, please?
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
08 Mar 2015 01:43 PM
Well, King. I did the same thing within my holo scripting, and it works.

FreeForAll = game.Lighting.FreeForAll
player4 = game.Players.LocalPlayer

textButton4.MouseButton1Down:connect(function(player4)
game.Lighting.FreeForAll:Clone()
:Clone().Parent = game.Workspace
wait(0.03)
local Message = Instance.new("Message")
Message.Parent = game.Workspace
Message.Text = "FreeForAll Loaded! Please wait for further instruction!"
wait(1)
Message:remove()

end)

Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:44 PM
"Can you help me figure out what the problem is, please?"
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
08 Mar 2015 01:45 PM
> Well, King. I did the same thing within my holo scripting, and it works.

You do realize that what you did is copy it, and then copy it again and then use that? You copied it twice.

I guarantee that this will work as well, but more effectively:

FreeForAll = game.Lighting.FreeForAll
player4 = game.Players.LocalPlayer

textButton4.MouseButton1Down:connect(function(player4)
game.Lighting.FreeForAll:Clone().Parent = game.Workspace
wait(0.03)
local Message = Instance.new("Message")
Message.Parent = game.Workspace
Message.Text = "FreeForAll Loaded! Please wait for further instruction!"
wait(1)
Message:remove()

end)

Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 01:45 PM
Again, can you help me with MY SCRIPT? Please..
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
08 Mar 2015 01:50 PM
There aren't any real problems with your script, but are you sure you want to clone the things into the backpack as they die?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 02:20 PM
Should I wait until the players respawn? How would I check for that.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
08 Mar 2015 02:26 PM
b
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
08 Mar 2015 03:48 PM
Instead of checking when the humanoid died, check when the character is added.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
if player.Class.Value == "Pusher" then
game.ServerStorage.Terraformer:Clone().Parent = player.Backpack
elseif player.Class.Value == "Guard" then
game.ServerStorage.Sword:Clone().Parent = player.Backpack
end
end)
end)
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