Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 29 Jan 2012 02:36 AM |
function onTouch(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil then game.Workspace.Winner.Value = hit.Parent.Name script.Parent.Parent:Remove() end end
script.Parent.Touched:connect(onTouch)
Ok, so, its in lighting, and then the minigame clones, this button is in it, its supposed to be the end of minigame thing. I dont really know whats wrong. |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 29 Jan 2012 04:37 AM |
if hit.Parent:findFirstChild("Humanoid") ~= nil then -- Why that complicated? if hit.Parent:findFirstChild("Humanoid") then -- easier Is Winner a string value? Check that. And make a debouncer. Scripts that work with touch interest get fired very often on one hit. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2012 04:43 AM |
| did you say the script is in Lighting, if so the script will not run, place it in Workspace |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 29 Jan 2012 04:56 AM |
| yeah the map with the button in it gets cloned from lighting. |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 29 Jan 2012 05:15 AM |
local debounce = false function onTouch(hit) debounce = true if hit.Parent:findFirstChild("Humanoid") then game.Workspace.Winner.Value = hit.Parent.Name game.Workspace.Map[game.Workspace.Map.Value]:Remove() debounce = false end end
script.Parent.Touched:connect(onTouch)
it still no work |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
| |
|