|
| 05 Sep 2014 06:02 PM |
I'm trying to make a skill that insta-kills people. The only problem is that I have no idea of how to spawn a collidable brick where the player is standing. Here's the current script I have.
Player = game.Players.Player1 mouse = Player:GetMouse()
function onKeyDown(key) key = key:lower() if key == "p" then x = Instance.new("Part", Workspace) x.BrickColor = BrickColor.new("Bright red") x.Size = Vector3.new(60, 60, 60) x.Shape = "Cylinder" x.TopSurface = "Smooth" x.BottomSurface = "Smooth" x.Position = Vector3.new(0, 0, 0) x.Anchored = true x.Parent = Workspace x.Rotation = Vector3.new(0,0,90) end end
mouse.KeyDown:connect(onKeyDown) |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Sep 2014 06:14 PM |
Also, I want people to freeze when they touch the red brick. I already made a function...
function onTouch(hit)
end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 05 Sep 2014 07:23 PM |
x.Position = Player.Character.Head.Position
?
to freeze people just anchor the torso. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 07:35 PM |
| No I mean OTHER players that are touching the cylinder |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 07:52 PM |
| Come on guys, I know that there's more than two people out there that are better at scripting at me... |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 05 Sep 2014 07:54 PM |
| Okay well are you trying to kill the player that is pressing the key? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 07:56 PM |
I know a MAJOR flaw your script has.
For the player variable, use game.Players.LocalPlayer and a LocalScript for the algorithm.
~ Dreams don't exist. It's yesterday tomorrow that does. ~ |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 08:03 PM |
@lord No I just want to freeze EVERYONE that is touching the red cylinder
@dev I will use that if I want others to use it, I just want ME to be using it. |
|
|
| Report Abuse |
|
|
| |
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 05 Sep 2014 08:21 PM |
Okay well in the future try to be as clear as you can possibly be.
So you want to create a part when someone pressed a key, and then everyone who touches that part from then on out gets frozen, correct? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 09:44 PM |
| Bingo. Then I'm going to create an animation which makes my character go sky high in the air and come crashing down causing players inside the part to die. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 05 Sep 2014 09:52 PM |
Well it might be a little easier to make the part ahead of time then clone it and set the CFrame. Since you are using the mouse this should already be in a local script?
Part.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame * CFrame.new(0,-2.5,0)
then you will have to make another function and fire it using the OnTouch event hooked up to the part. |
|
|
| Report Abuse |
|
|