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: Doesnt work

Previous Thread :: Next Thread 
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
04 Jul 2014 08:08 PM
this doesnt work, it doesnt even print("Touched spawns")

function getSpawns()
for i,v in pairs(game.Workspace.SpawnBox:GetChildren()) do
if v:IsA("SpawnLocation") then
AllSpawns = v
end
end
end

function hit(h)
pppp = game.Players:FindFirstChild(h.Parent.Name)
print("Touched spawns")
if gameGo.Value == true then
table.remove(PlayersAlive, pppp.TableLocation.Value)
print("removed plr from position:"..pppp.TableLocation.Value)
end
end

getSpawns()
AllSpawns.Touched:connect(hit)
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
04 Jul 2014 08:12 PM
for i,v in pairs(game.Workspace.SpawnBox:GetChildren()) do
if v:IsA("SpawnLocation") then
v.Touched:connect(function(h)
pppp = game.Players:FindFirstChild(h.Parent.Name)
print("Touched spawns")
if gameGo.Value == true then
table.remove(PlayersAlive, pppp.TableLocation.Value)
print("removed plr from position:"..pppp.TableLocation.Value)
end
end)
end
end
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
04 Jul 2014 08:14 PM
Still doesnt work
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
04 Jul 2014 08:14 PM
function getSpawns()
for i,v in pairs(game.Workspace.SpawnBox:GetChildren()) do
if v:IsA("SpawnLocation") then
AllSpawns = v
AllSpawns.Touched:connect(function(Toucher)
if Toucher.Parent and game.Players:FindFirstChild(Toucher.Parent.Name) then
function hit(h)
Player = game.Players:FindFirstChild(Toucher.Parent.Name)
print("Touched spawns")
if gameGo.Value == true then
table.remove(PlayersAlive, pppp.TableLocation.Value)
print("removed plr from position:"..pppp.TableLocation.Value)
end
end
end
end)
end
end
end
getSpawns()
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
04 Jul 2014 08:22 PM
Still didnt work. I just did this instead:

function hit(h)
if h.Parent:findFirstChild("Humanoid") then
Player = game.Players:FindFirstChild(h.Parent.Name)
print("Touched spawns")
if gameGo.Value == true then
table.remove(PlayersAlive, pppp.TableLocation.Value)
print("removed plr from position:"..pppp.TableLocation.Value)
end
end
end

spawns = game.Workspace.SpawnBox
spawns.one.Touched:connect(hit)
spawns.two.Touched:connect(hit)
spawns.three.Touched:connect(hit)
spawns.four.Touched:connect(hit)
spawns.five.Touched:connect(hit)
spawns.six.Touched:connect(hit)
spawns.seven.Touched:connect(hit)
spawns.eight.Touched:connect(hit)
spawns.nine.Touched:connect(hit)
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