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: Teleport problem, help please?

Previous Thread :: Next Thread 
lensky is not online. lensky
Joined: 05 Apr 2009
Total Posts: 884
21 Aug 2016 04:34 PM
Okay so, I have here a teleport script that's supposed to teleport the person who clicked the brick "Origin" and will be teleported to the brick "Destination" and will spawn a loading GUI to the person. Now the problem is, that when a certain individual clicks the Origin, everyone in the server gets teleported to the Destination.

function onClicked(player)
local gui = Instance.new("ScreenGui", player.PlayerGui)
local label = Instance.new("TextLabel", gui)
label.Size = UDim2.new(2, 0, 2, 0)
label.Position = UDim2.new(-0.5, 0, -0.5, 0)
label.BackgroundColor3 = Color3.new(0,0,0)
label.BackgroundTransparency = 1
label.Text = ""
local p = game.Players:GetChildren()
for i = 1, #p do
wait(0.25)
while gui and label and label.BackgroundTransparency > 0 do
wait()
label.BackgroundTransparency = label.BackgroundTransparency - 0.5
end
p[i].Character:MoveTo(script.Parent.Parent.Destination.CFrame.p)
wait(3)
end
while gui and label and label.BackgroundTransparency < 1 do
wait()
label.BackgroundTransparency = label.BackgroundTransparency + 0.5
end
if gui then
gui:Remove()
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

I believe the problem in the script is the "local p = game.Players:GetChildren()" which selects all the players, I just don't know what to replace it with. Please help.
Report Abuse
lensky is not online. lensky
Joined: 05 Apr 2009
Total Posts: 884
21 Aug 2016 04:39 PM
Hallo?
Report Abuse
lensky is not online. lensky
Joined: 05 Apr 2009
Total Posts: 884
21 Aug 2016 04:44 PM
Bumper cars. ):
Report Abuse
lensky is not online. lensky
Joined: 05 Apr 2009
Total Posts: 884
21 Aug 2016 04:48 PM
I really need help with this.
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
21 Aug 2016 04:50 PM
replace p's value with the 'player' parameter in your function.
also for god's sake please clean up your code
(im a hypocrite though you should see my lua code)
and if it doesnt work then why do you have an argument that is supposed to be the player.....
Report Abuse
lensky is not online. lensky
Joined: 05 Apr 2009
Total Posts: 884
21 Aug 2016 04:55 PM
Mmk
and the reason why it looks dirt is cus it's supposed to spawn a GUI to the player who cliked it. Kay?
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
21 Aug 2016 04:56 PM
ok
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