|
| 13 Sep 2017 02:38 PM |
I wanted to make a part that Rises and Kills any player that touches it, So I made this script
script.Parent.Touched:connect(function(hit) local player = hit.Parent:FindFirstChild("humanoid") if player ~= nil then player.Health = 0 end end)
while true do script.Parent.Size = script.Parent.Size + Vector3.new(0.3,0,0) wait(.1) end
It works, but when I add the script that kills whoever touches the part, It messes up, When I add the script to the part, the part does not come in contact with me, whenever I touch it, it does not let me go through it, to understand the problem better recreate it
Step 1. make a part that has its CollisionGroupId set to 1 then set its CanCollide option to False then unAnchor it then set its bottomSurface to Inlet and the rest to smooth
Step 2. put a script inside of the Part and copy and past the script I wrote into it and don't change anything
Step 3. Try it with the Touch script then Try it without the Touch script and see what happens
|
|
|
| Report Abuse |
|
|
he_ro
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 634 |
|
|
| 13 Sep 2017 02:49 PM |
shot in the dark here, but try
spawn(function() while wait(.1) do script.Parent.Size = script.Parent.Size + Vector3.new(0.3,0,0) end end)
|
|
|
| Report Abuse |
|
|
iiNemo
|
  |
| Joined: 22 Jul 2013 |
| Total Posts: 2380 |
|
|
| 13 Sep 2017 02:50 PM |
| if the loop is above the touched event, then the guy above has the right answer. |
|
|
| Report Abuse |
|
|
| |
|
he_ro
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 634 |
|
|
| 13 Sep 2017 02:56 PM |
same place you had it before
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 02:57 PM |
but it don't kill the player when he touches it
|
|
|
| Report Abuse |
|
|
he_ro
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 634 |
|
|
| 13 Sep 2017 02:59 PM |
local player = hit.Parent:FindFirstChild("Humanoid")
capital h
|
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 13 Sep 2017 03:00 PM |
spawn(function() while wait(.1) do script.Parent.Size = script.Parent.Size + Vector3.new(0.3,0,0) end end)
script.Parent.Touched:Connect(function(hit) local player = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") if player ~= nil then player.Health = 0 end end)
you forgot to capitalize "Humanoid", also made it work if it gets touched by a hat or a tool
help me: https://www.roblox.com/library/1032745459/Support-me-buying-a-russian-cap |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:00 PM |
script.Parent.Touched:connect(function(hit) local player = hit.Parent:FindFirstChild("Humanoid") if player ~= nil then player.Health = 0 end end) spawn(function() while wait(.1) do script.Parent.Size = script.Parent.Size + Vector3.new(0.3,0,0) end end)
is this right
|
|
|
| Report Abuse |
|
|
he_ro
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 634 |
|
| |
|
|
| 13 Sep 2017 03:03 PM |
The same thing happens, it kills the player but glitches
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:04 PM |
do it in edit mode and follow my steps
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:09 PM |
Changing the size really close to doing other stuff can be bad
For example, if i were to set the size of a bullet, then add the force directly after it, it would just float in midair.
Try another method other than sizing it |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:12 PM |
what do you suppose I do, add a wait between the Touch and Size script??
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:13 PM |
at this point im willing to pay someone if they help me
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2017 03:13 PM |
| Try lerping it out of the ground |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Sep 2017 03:16 PM |
Linear interpolation, it's a function to move something from point a to b
http://wiki.roblox.com/index.php?title=CFrame#Methods |
|
|
| Report Abuse |
|
|