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: Help Please

Previous Thread :: Next Thread 
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
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 is not online. 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
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
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
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
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 is not online. 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
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
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 is not online. Marolex
Joined: 17 Dec 2012
Total Posts: 1785
08 Mar 2014 09:22 AM
You didnt explain "Player"
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
08 Mar 2014 09:26 AM
How do I do that?
Player = game.Players ?
I have no idea. Please help.
Report Abuse
Marolex is not online. 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 is not online. 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
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