|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 07:59 PM |
| checked it, didn't work. Any help? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 08:01 PM |
| Oh okay, I just started scripting 10 minutes ago q_q |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 08:01 PM |
LOL Hang on I'll help in a moment. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 08:03 PM |
"Game.Workspace.BasePlate == false" "Game.Workspace.Players:delete()" |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 08:04 PM |
| Is that a correction or what? o3o |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 08:07 PM |
| Yeah basically, what I want is when the baseplate is changed the game/server will shutdown. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 08:09 PM |
| Thanks! :D I am trying to learn scripting, can you guys teach me some basics? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 08:18 PM |
For that script
if script.Parent.Anchored == true then print("True") else print("False") end |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 08:19 PM |
| Hmm interesting, this sure is helping me learn the basics :D |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 08:26 PM |
| Yeah, if every player's name was "Player". |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 26 Jan 2015 08:29 PM |
| I haven't done much with the services. So sorry no. :( |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|