of     1   

callduty200
#171069881Thursday, August 13, 2015 10:46 PM GMT

im triying to make a respawn button to respawn cars but when you go in test and you dont press the button there gone local respawnCarsBlock = game.Workspace.RespawnCarsBlock function respawnCars() print("I am going to respawn now.") end for _, object in pairs(game.Workspace:GetChildren()) do print(object.Name) if object.Name == "Car" then print("This is a Car! We need to destroy it") object:Destroy() end end respawnCarsBlock.Touched:connect(respawnCars) and its in server scriptstorege plzz help
Iterum
#171069997Thursday, August 13, 2015 10:47 PM GMT

Not sure why when you try to copy paste the code it's doing this. Maybe it's the browser or something? Or the code itself is oddly shaped? I don't know. -ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
callduty200
#171070068Thursday, August 13, 2015 10:48 PM GMT

hold on ima write the code down
callduty200
#171070210Thursday, August 13, 2015 10:49 PM GMT

local respawnCarsBlock = game.Workspace.RespawnCarsBlock function respawnCars() print("I am going to respawn now.") end for _, object in pairs(game.Workspace:GetChildren()) do print(object.Name) if object.Name == "Car" then print("This is a Car! We need to destroy it") object:Destroy() end end respawnCarsBlock.Touched:connect(respawnCars)
Iterum
#171071357Thursday, August 13, 2015 10:59 PM GMT

What is the problem & relevant output? -ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
Iterum
#171071421Thursday, August 13, 2015 11:00 PM GMT

Also you don't use proper validation for the Touched event. You should be using a debounce and also check to make sure what touches it is a player. -ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
callduty200
#171071527Thursday, August 13, 2015 11:01 PM GMT

yes
callduty200
#171071583Thursday, August 13, 2015 11:02 PM GMT

yes its a player
Iterum
#171071764Thursday, August 13, 2015 11:03 PM GMT

No, what I'm saying is that other things can touch the respawn part, and you didn't check to make sure that it is a player that is touching it before doing stuff. Proper Touched event validation: if hit.Parent then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then end end Also a debounce should be added ASAP. -ChiefDelta/Discommodate/iC7G/Vulnerite + 100 other accounts
callduty200
#171071896Thursday, August 13, 2015 11:04 PM GMT

um okay
callduty200
#171072048Thursday, August 13, 2015 11:05 PM GMT

the cars are there but there not destroyed when i walk on the button

    of     1