|
| 02 Dec 2011 03:05 PM |
Ok, it's a Gui that teleports all the players on one team. It copies a localscript so the teleport GUI pops up. It works in visit but not place...
Here's the GUI script:
script.Parent.MouseButton1Down:connect(function() plrs = game.Players:GetChildren()
for i,v in pairs(plrs) do if (v.TeamColor == BrickColor.new("Camo")) then if v.Character:findFirstChild("Teleport") == nil then game.Lighting.Teleport:clone().Parent = v.Character v.Character.Teleport.TeleportId.Value = 49927719 v.Character.Teleport.Disabled = false wait(1) v.Character.Teleport:remove() end end end end)
Here's the LocalScript:
id = script.TeleportId.Value if (script.Parent.ClassName == "Model") then game:GetService("TeleportService"):Teleport(id) end
Help pl0x? |
|
|
| Report Abuse |
|
|
| |
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 02 Dec 2011 03:18 PM |
| If that is local script then you should add script what will activate local script after few seconds. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2011 03:21 PM |
| Dude, the one in the gui clones it then activates it. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 02 Dec 2011 03:21 PM |
Why don't you put is all in one script?
local YesOrNo = STRINGVALUE
YES.MouseButton1Down:connect(function() YesOrNo = "yes" connection:disconnect() end)
No.MouseButton1Down:connect(function() YesOrNo = "no" connection:disconnect() end)
YesOrNo.Changed:connect(function(p) if p:lower() == "yes" then --teleport else GUI:remove() connection:disconnect() end end) ~Myrco; Music lover, nederlands/dutch and a scripter |
|
|
| Report Abuse |
|
|
Jesustrt
|
  |
| Joined: 20 May 2010 |
| Total Posts: 27 |
|
|
| 02 Dec 2011 03:25 PM |
| well your place id is not right this is how {http://www.roblox.com/Forum/AddPost.aspx?PostID=58973295&mode=flat} see but not just like that go to you place but dont play and copy or move the id into the scirpt done! |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2011 03:26 PM |
| I would, but it's multiple buttons (different places) (in a Gui) that asks to teleport all the players from one team. |
|
|
| Report Abuse |
|
|
|
| 02 Dec 2011 03:27 PM |
| I know what I'm doing, the script works fine in Visit mode, but not in Multiplayer. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 02 Dec 2011 03:32 PM |
@lord: You could always hook up multiple connections to created funtions upon multiple buttons.
~Myrco; Music lover, nederlands/dutch and a scripter |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 02 Dec 2011 03:34 PM |
Well I'm thinking that you didn't parent the LocalScript to the Pklayer (unless it's in a Gui that's in StarterGui).
~Myrco; Music lover, nederlands/dutch and a scripter |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 02 Dec 2011 03:43 PM |
And making multiple anonymous functions (I maily use them unless I need it really costum like making maths or so easier) can be done in multiple ways, one is the one like I did before, making them apart. Anoter one is itterating;
local parts = {}
for x = 1, math.random(10, 20), 1 do local p = Instance.new("Part", workspace) p.Anchored = true p.BrickColor = BrickColor.random() p.CFrame = CFrame.new(math.random(-100, 100), math.random(10, 100, math.random(-100, 100)) table.insert(parts, #parts + 1, p) end
for _,v in pairs (parts) do v.Touched:connect(function(p) Instance.new("Explosion", workspace).Position = v.Position v:remove() connection:disconnect() end) end
for _,v in pairs (parts) do v.Anchored = false end ~Myrco; Music lover, nederlands/dutch and a scripter |
|
|
| Report Abuse |
|
|