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: Please correct this,

Previous Thread :: Next Thread 
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 07:57 PM
if Game.Workspace.BasePlate == false
or Game.Workspace.Baseplate.Achored == false then
Game.Workspace.Players:delete() else
print("Protection active...")
end

------------------------------------------------------------------------------------------

Please correct this script for me, its supposed to remove all players if a server in my 'Game' has a unanchored baseplate or the baseplate is removed.

Thanks,
-HeadlessHorror
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 07:58 PM
gg I think the reason it isn't working is because I put "achored" and not "anchored" let me test this.
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 07:59 PM
You should really look into this yourself. You made so many errors (on beginner scripting) that helping you would be doing all the work FOR you.
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 07:59 PM
checked it, didn't work. Any help?
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:01 PM
Oh okay, I just started scripting 10 minutes ago q_q
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 08:01 PM
LOL
Hang on I'll help in a moment.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
26 Jan 2015 08:03 PM
"Game.Workspace.BasePlate == false"
"Game.Workspace.Players:delete()"
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:04 PM
Is that a correction or what? o3o
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
26 Jan 2015 08:06 PM
What are you trying to check at first?
:delete() isnt a method, but :Destroy() is. But you still cant destroy Players.
Are you trying to kick everyone?
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 08:07 PM

--Original condition
if not Game.Workspace.BasePlate or Game.Workspace.Baseplate.Anchored==false then
--Loop to check children under Workspace
for i, child in pairs(Workspace:GetChildren()) do
--TO see child is a player
for v, child1 in pairs(child:GetChildren()) do
if child1:IsA("Huamnoid") then
--To destroy player
child:Destroy()
end
end
end
print("Protection active...")
end
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:07 PM
Yeah basically, what I want is when the baseplate is changed the game/server will shutdown.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
26 Jan 2015 08:08 PM
Workspace:WaitForChild("BasePlate").Changed:connect(function()
for _,player in pairs(game.Players:GetPlayers()) do
player:Kick()
end
end)
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:09 PM
Thanks! :D I am trying to learn scripting, can you guys teach me some basics?
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
26 Jan 2015 08:11 PM
Dont have a messy style, like what is this;

if something
or somethingelse then

Turn it into this;

if something or somethingelse then
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:17 PM
Wait so instead of my 'messy' scripts I need to do things like:

if script.Parent.Anchored == true then print("True")
else print("False")
end

or is that not going to work?
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 08:18 PM
For that script

if script.Parent.Anchored == true then
print("True")
else
print("False")
end
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:19 PM
Hmm interesting, this sure is helping me learn the basics :D
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:21 PM
Just a quick question, what do 'Localscripts' do? Could you use them to check if locally a part is still 'active' in your game?
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:26 PM
I just made this quick script, would this work?



if Game.Workspace.Player == true then
    print("Player is active")
else
    print("Player is not here")
end
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 08:26 PM
Yeah, if every player's name was "Player".
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:28 PM
Sorry that this is so advanced, but its my dream to make a GUI which counts the amount of players in my group using HttpService, do you have any clue how?
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
26 Jan 2015 08:29 PM
I haven't done much with the services. So sorry no. :(
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
26 Jan 2015 08:31 PM
That wouldn't work if the player wasn't there because of the way ROBLOX does their hierarchy. Instead, you'd have to do if game.Workspace:FindFirstChild("Player") then

If the player exists, it will return the player, otherwise it will return nil. You could have been indexing nil, which results in an error.
Report Abuse
HeadlessHorror is not online. HeadlessHorror
Joined: 05 Dec 2011
Total Posts: 505
26 Jan 2015 08:31 PM
This is my final question for a while, do you have any clue how to make a **Textlabel**'s colour constantly change [possibly using math.random]?
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