sal212
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 2929 |
|
|
| 04 Jul 2015 09:57 AM |
Could you help me on a script where only some players can step on a brick and others that I dont list die? (Not a door) Just a brick.
New at scripting. |
|
|
| Report Abuse |
|
|
sal212
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 2929 |
|
| |
|
Altra0x8
|
  |
| Joined: 19 Nov 2012 |
| Total Posts: 22 |
|
| |
|
|
| 04 Jul 2015 10:06 AM |
ur not helping im not helping im new too i dont know where to start scripting yolo |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2015 10:12 AM |
You can kill people by doing the following:
function onTouch(otherPart)
if(otherPart.Parent:FindFirstChild("Humanoid") ~= nil) then
otherPart.Parent:FindFirstChild("Humanoid").Health = 0
end
end
script.Parent.Touched:connect(onTouch)
Now for making it so that some players that you list don't die you should add another if statement, where you can check the player's IDs. For example:
function onTouch(otherPart)
if(otherPart.Parent:FindFirstChild("Humanoid") ~= nil) then
if(game.Players:GetPlayerFromCharacter(otherPart.Parent).Name == "YourNameHere") then
otherPart.Parent:FindFirstChild("Humanoid").Health = 0
end
end
end
There is a way to check for userID's but I can't find anything on it so I'm not sure how it works. What I have given you there will still work though.
Any more questions feel free to ask. By the way the script goes in the block you want to kill people |
|
|
| Report Abuse |
|
|