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 » Scripting Helpers
Home Search
 

Re: AHHHH This works in Visit but not in a place with others, why?

Previous Thread :: Next Thread 
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
02 Dec 2011 03:14 PM
AHHHH
Report Abuse
zars15 is not online. 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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
02 Dec 2011 03:21 PM
Dude, the one in the gui clones it then activates it.
Report Abuse
TheMyrco is not online. 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 is not online. 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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
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
LordStriked is not online. LordStriked
Joined: 19 Mar 2011
Total Posts: 5396
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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