|
| 08 Mar 2014 08:47 AM |
I was wondering how to crash someone when they touch a brick. Here's what I have:
function onTouched(hit) H = hit.Parent:FindFirstChild("Humanoid") if H ~= nil then -- CRASH SCRIPT GOES HERE wait(.001) end end
script.Parent.touched:connect(onTouched)
I don't want hit.Parent:remove() Because then they'll be able to fly around. Thanks, please help? |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 08 Mar 2014 08:51 AM |
Why crash them? It's completely unnecessary and overkill.
Look into the 'Kick' method.
http://wiki.roblox.com/index.php?title=Kick |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2014 09:00 AM |
I'm doing a Hunger Games. I don't want people to fly around and give the still-alive Tributes tips and such. Also, I don't want them to spam their reset so the death cannon goes off a whole bunch.
That's why I want crash. I added a crash script that I found:
function onTouched(hit) H = hit.Parent:FindFirstChild("Humanoid") if H ~= nil then -- CRASH SCRIPT GOES HERE wait(.001) end end
script.Parent.touched:connect(onTouched)
Inside the script is a LocalScript with: while true do end
But it doesn't work. Please help?
|
|
|
| Report Abuse |
|
|
|
| 08 Mar 2014 09:01 AM |
Whoops, I forgot to add part of the script. Replace '-- CRASH SCRIPT GOES HERE' with:
script.LocalScript:Clone().Parent.Parent = player:findFirstChild("PlayerGui") |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 08 Mar 2014 09:05 AM |
| Again, I reiterate that crashing them is incredibly overkill and completely unnecessary. If you want to remove them from your game, look into the 'Kick' method which disconnects their client from the server. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2014 09:06 AM |
All right. But it doesn't work:
function onTouched(hit) H = hit.Parent:FindFirstChild("Humanoid") if H ~= nil then Player:Kick() wait(.001) end end
script.Parent.touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
Marolex
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 1785 |
|
|
| 08 Mar 2014 09:22 AM |
| You didnt explain "Player" |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2014 09:26 AM |
How do I do that? Player = game.Players ? I have no idea. Please help. |
|
|
| Report Abuse |
|
|
Marolex
|
  |
| Joined: 17 Dec 2012 |
| Total Posts: 1785 |
|
|
| 08 Mar 2014 09:27 AM |
You need to expound on that.
you have "Player:Kick()"
so define player
Player = ? Player:Kick() |
|
|
| Report Abuse |
|
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 08 Mar 2014 09:28 AM |
Something in this style, not sure if this will work. Give it a shot! xD
game.Players[hit.Parent.Name]:Kick() |
|
|
| Report Abuse |
|
|