|
| 14 Apr 2012 07:52 PM |
| How would i make it so that i can have one script inside of each person, and when they touch something, with anypart of there body, the script fires? |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 14 Apr 2012 08:04 PM |
You make a script that puts it in the player's then,
for i,v in pairs(script.Parent:GetChildren()) do if v:IsA("Part") then v.Touched:connect(function(Part) --Script end) end end |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2012 08:14 PM |
Would this work , just as much as that?
debounce = false
function HeadTouched(hit) if debounce == false then debounce = true msg = Instance.new("Message", Workspace) msg.Text = "Head Touched" wait(3) msg:Destroy() debounce = false end end
script.Parent:FindFirstChild("Head").Touched:connect(HeadTouched)
function LeftArmTouched(hit) if debounce == false then debounce = true msg = Instance.new("Message", Workspace) msg.Text = "Left Arm Touched" wait(3) msg:Destroy() debounce = false end end
script.Parent:FindFirstChild("Left Arm").Touched:connect(LeftArmTouched) |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2012 08:15 PM |
@Un
I'm not sure, but if it did, it is not as efficient...
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2012 08:23 PM |
| ok, well thanks for the help. |
|
|
| Report Abuse |
|
|