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 » Game Design
Home Search
 

Re: script is fine, but doesn't run

Previous Thread :: Next Thread 
lowvillan is not online. lowvillan
Joined: 14 Sep 2010
Total Posts: 725
04 Jan 2015 08:53 PM
i have a script that puts a script in a player, then enable it so it can do stuff, however, when the script is put into the player, it doesn't even run, even though it isn't disabled.

script that puts other script into the player:
game.Players.PlayerAdded:connect(function(plr)
plr:WaitForChild("Character")
local oc = script.OnDeath:Clone()
oc.Parent = plr
oc.Disabled = false
end)
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
04 Jan 2015 08:55 PM
plr:WaitForChild("Character.Humanoid")
Report Abuse
lowvillan is not online. lowvillan
Joined: 14 Sep 2010
Total Posts: 725
04 Jan 2015 08:58 PM
@legend
sadly, no dice
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
04 Jan 2015 09:01 PM
game.Players.PlayerAdded:connect(function(plr)
plr:WaitForChild("Character")
local oc = script.OnDeath:Clone()
oc.Disabled = false
oc.Parent = plr
end)
Report Abuse
lowvillan is not online. lowvillan
Joined: 14 Sep 2010
Total Posts: 725
04 Jan 2015 09:06 PM
still, no.

i have also noticed that waitforchild doesn't seem to work well with this script, as it simply waits, and nothing happens.
Report Abuse
BioMatrix is not online. BioMatrix
Joined: 22 Mar 2014
Total Posts: 693
04 Jan 2015 09:07 PM
You could try and ask the scripters in the scripters forum they might know
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
04 Jan 2015 09:11 PM
nvm that doesn't help, I think I found your problem though.

>script.OnDeath:Clone()

I don't think scripts can die?

local script = --Idk what script you are giving

game.Players.PlayerAdded:connect(function(plr)
local char = plr:WaitForChild("Character")
char.Humanoid.Died:connect(function()
local oc = script:clone()
oc.Parent = plr
oc.Disabled = false
end)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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