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: Very Important Script!!!

Previous Thread :: Next Thread 
Gnago is not online. Gnago
Joined: 28 Jan 2014
Total Posts: 372
11 Aug 2014 04:50 PM
I need help please, more details after the script


script.Parent.Touched:connect(function(t)
if t.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(t.Parent.Name) and t.Parent.Humanoid.Health > 0 then
local g = game.ServerStorage.Terrains.Aqua.Kraken:Clone()
g.Parent = Workspace
g:MoveTo(Workspace.Thing.Spawnpoint.Position)
end
end)

ok, so What THIS script does is when the player touches the brick that holds this script, a model (In this script its "Kraken" which is inside of "Aqua" Which is in "Terrains") is teleported to the Brick "Spawnpoint" which is in the model "Thing"

Now, what I want is when the player touches the brick that holds this script, one of the 7 models inside of the model "Aqua" which is inside of "Terrains", is teleported to the Brick "Spawnpoint" which is in the model "Thing"

I got a small math.random script which I think can be edited in, but not sure if it will work.

local SelectedNumber = math.random(7)
local ModelsToSelect = Aqua:GetChildren()



Help would be appreciated, Thanks!


I also have this script that someone made from this but it doesn't work, So if you find a mistake in this one, it might work. I'm uncertain about the #g on the 7th-ish line. youll see it...

deb = false
script.Parent.Touched:connect(function(t)
if deb == false then
deb = true
if t.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(t.Parent.Name) and t.Parent.Humanoid.Health > 0 then
local g = game.ServerStorage.Terrains.Aqua:GetChildren()
x = math.random(1,#g)
g = game.ServerStorage.Terrains.Aqua[x]
g.Parent = Workspace
g:MoveTo(Workspace.Thing.FFF.Position)
deb = false
end
end
end)


This script was also given to me, but it is REALLY laggy (So that probably means it works), I cant even move my character in Play Solo, and I cant even get into the game via site. So if You can fix any of these That would be really great, This script is the Core of my game. Thanks!

deb = false
script.Parent.Touched:connect(function(t)
if deb == false then
deb = true
if t.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(t.Parent.Name) and t.Parent.Humanoid.Health > 0 then
local g = game.ServerStorage.Terrains.Aqua:GetChildren()[math.random(#game.ServerStorage.Terrains.Aqua:GetChildren())]
g.Parent = Workspace
g:MoveTo(Workspace.Thing.FFF.Position)
deb = false
end
end
end)


Thanks so Much! You'll get a mention at the least and maybe your own character even (Though I don't think these rewards woul interest you much...)

Thank You!
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
11 Aug 2014 04:51 PM
much words much bored much complicated
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
11 Aug 2014 04:56 PM
@ali

and you expect people to help you
Report Abuse
Gnago is not online. Gnago
Joined: 28 Jan 2014
Total Posts: 372
11 Aug 2014 05:43 PM
are you saying that to ali or agreeing with ali and saying that to me?
Report Abuse
redroar is not online. redroar
Joined: 30 Oct 2008
Total Posts: 147
11 Aug 2014 06:09 PM
Ok so I am not that good of a scripter but you wrote:
local SelectedNumber = math.random(7)
should it not be:
local SelectedNumber = math.random(1, 7)

Sorry if this is wrong but if it is the I am glad I can help :)
Report Abuse
Krypticon is not online. Krypticon
Joined: 12 Feb 2014
Total Posts: 680
11 Aug 2014 06:42 PM
math.random(7) works as well :)
Report Abuse
redroar is not online. redroar
Joined: 30 Oct 2008
Total Posts: 147
12 Aug 2014 04:20 AM
Ok krypt thanks :)
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