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: Why Won't This Script Work?

Previous Thread :: Next Thread 
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 08:35 AM
Nothing happens when I test it..

local Frame = script.Parent:WaitForChild("Frame")
function join(player)
local value = Instance.new("BoolValue")
value.Parent = game.Workspace
value.Value = true
value.Parent = game.Workspace
if value.Value == true then
Frame:Destroy()
end
end
game.Players.PlayerAdded:connect(join)


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 08:38 AM
Then that can means three things:

- The script is disabled
- The script is a LocalScript, which makes PlayerAdded work funny
- "Frame" is never being found << probably this one

Check to see if Frame is actually there when you test in Studio.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 08:40 AM
How would you enable a script?


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 08:41 AM
Click on it in Studio, look down at the Properties box and check if there is a check in the box named "Disabled" (it'll be at the bottom).

If the box is empty, your script is already enabled.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 08:43 AM
It is enabled.. It's not a local script and I'm 100% sure that the parent for the frame is right..


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 08:45 AM
print("Starting wait now")
local Frame = script.Parent:WaitForChild("Frame")
print("Ending wait now")
function join(player)
local value = Instance.new("BoolValue")
value.Parent = game.Workspace
value.Value = true
value.Parent = game.Workspace
if value.Value == true then
Frame:Destroy()
end
end
game.Players.PlayerAdded:connect(join)

-- Try this script and check the Output in Studio, tell me what it says
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 08:50 AM
"Starting wait now"
That's all it says..


Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
18 Feb 2016 08:53 AM
Then it doesn't find a child called 'Frame'


Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 08:54 AM
Sorry about that I moved the script to the workspace without thinking..
I moved it back and now it does both the print things..


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 08:58 AM
It should work now.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 09:00 AM
Still not working..
But there's no value in the workspace from Instance.new


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 09:01 AM
Go to the TEST tab in Studio, and click the "Start" button with a picture of server switches. That will create a local game server inside of your computer for you to test on. It'll probably work there.

PlayerAdded works in weird ways when you're using Solo mode.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 09:07 AM
It worked..
But the thing is the script was meant for a solo game..
How would I fix it so it would be able to work on solo?


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
18 Feb 2016 09:20 AM
If you mean a game server with only 1 player in it, it'll work fine. "Play Solo" means the entire game is run on the client's computer so PlayerAdded kinda breaks.
Report Abuse
Kramer777 is not online. Kramer777
Joined: 07 Sep 2013
Total Posts: 14696
18 Feb 2016 09:25 AM
Yeah..


Report Abuse
ownedyou1 is not online. ownedyou1
Joined: 03 Jul 2008
Total Posts: 528
18 Feb 2016 10:12 AM
i personally would have done repeat wait() until script.Parent:findFirstChild("Frame")~=nil local Frame = script.Parent.Frame
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