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: Scripts Thats could be Fixed.

Previous Thread :: Next Thread 
CptBenge is not online. CptBenge
Joined: 22 Jun 2012
Total Posts: 823
31 Oct 2012 12:38 PM
Here are a few Scripts that are broken and need fixing for a game I have. I have tried to fix these and I'm just learning LUA Language. Anyone Help Please?


Hunger kills if "hunger" value 0.
-----------------------------------------------
while true do
if script.Parent.hunger.Value == 0 then
function kill(h)
h.Health = 0
end
end
------------------------------------------------

This Scripts random spawns you when you enter game from Vector3 location.
------------------------------------------------
while wait(9) do
local a=Instance.new("Part",game.Workspace)
a.Position=Vector3.new(math.random(9,15),1,1)
end
------------------------------------------------

Part of Random Zombie Spawn From Vector3 Location.
------------------------------------------------
while true do
local zombie1 = game.Lighting.Zombies.Zombie1.Zombie:clone()
position=Vector3.new(math.random(9,15),1,1)
end
--------------------------------------------------


~CptBenge
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 12:48 PM
while true do
if script.Parent.hunger.Value == 0 then
--Define h then this will work
h.Health = 0
end
------------------------------------------------

This Scripts random spawns you when you enter game from Vector3 location.
------------------------------------------------
while wait(9) do -- Place a brick at a random location every 9 seconds.
local a = Instance.new("Part", workspace)
a.Position = Vector3.new(math.random(9,15),1,1)
end
------------------------------------------------

Part of Random Zombie Spawn From Vector3 Location.
------------------------------------------------
while true do -- should be fine.
local zombie1 = game.Lighting.Zombies.Zombie1.Zombie:clone()
zombie1.Parent = workspace
zombie1:MakeJoints()
zombie1:MoveTo(Vector3.new(math.random(9,15),1,1))
end

next time post the errors.
Report Abuse
cyclone3260 is not online. cyclone3260
Joined: 23 Aug 2010
Total Posts: 1038
31 Oct 2012 12:50 PM
while true do
if script.Parent.hunger.Value == 0 then
function kill(h)
h.Health = 0
wait()
end
end
-------------

while true do
local zombie1 = game.Lighting.Zombies.Zombie1.Zombie:clone()
zombie1.Parent = game.Workspace
position=Vector3.new(math.random(9,15),1,1)
wait()
end

~+CClone+~

Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 12:50 PM
I should have added in those wait()s and that extra end, woops.
Report Abuse
CptBenge is not online. CptBenge
Joined: 22 Jun 2012
Total Posts: 823
31 Oct 2012 01:02 PM
Thanks :) Helps me out.
Report Abuse
CptBenge is not online. CptBenge
Joined: 22 Jun 2012
Total Posts: 823
31 Oct 2012 01:08 PM
On this script it seems a bit confusing.


What I wanted this script to do is when a player enters the game it spawns them at random from vector3 Location. But within the map.


This Scripts random spawns you when you enter game from Vector3 location.
------------------------------------------------
while wait(9) do
local a = Instance.new("Part", workspace)
a.Position = Vector3.new(math.random(9,15),1,1)
end
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
31 Oct 2012 01:17 PM
"local a = Instance.new("Part", workspace)"


"What I wanted this script to do is when a player enters the game it spawns them at random from vector3 Location. But within the map."

what?
Report Abuse
HaxHelper is not online. HaxHelper
Joined: 19 Dec 2009
Total Posts: 1208
31 Oct 2012 01:18 PM
I think he wants to teleport players to random points on the map. For that, it would probably be best if you had a table of Vector3 positions and then look up one of those to move a player to.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 01:37 PM
Well if your doing it that way you may just want to place a bunch of spawn points down and roblox will do that rest.
Report Abuse
CptBenge is not online. CptBenge
Joined: 22 Jun 2012
Total Posts: 823
31 Oct 2012 01:40 PM
I'll try explain it more.


This script is ment to do this. When a Player enters the game it teleports/spawns them randomly. Not on a spawn point.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 01:43 PM
Well that is totally different from the script you posted for fixing, you need to use a Child Added or Player Joined function then use MoveTo(math.random(-Whatever, whatever), math.random(-Whatever, whatever), math.random(-Whatever, whatever))
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Oct 2012 01:44 PM
Players.PlayerAdded:connect(function(p)
Delay(.5,function()p:LoadCharacter()end)
p.CharacterAdded:connect(function(c)
c:MoveTo(Vector3.new(math.random(-300,300),15,math.random(-300,300))
end)
end)


wat
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