IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 20 Jul 2013 09:15 PM |
local debounce = false function onTouched(hit) local t = hit.Parent:findFirstChild("Torso") local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if debounce == false then debounce = true if plr:IsInGroup(678906) then game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(4, 3, -139)) wait(3) debounce = false end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
| |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
| |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 20 Jul 2013 09:21 PM |
| In script helpers no one ever helps me ugh |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
| |
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 20 Jul 2013 10:04 PM |
| plr.Character.Torso.CFrame = CFrame.new(4, 3, -139) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 Jul 2013 10:09 PM |
You should use your if statement for your debounce before you start trying to index things. Also, you should check to see if 'plr' exists before accessing it. Instead of checking for the Torso, you can just use the MoveTo method on the Character model. You messed up when indexing the Torso, the second time. Instead of using that variable, you tried accessing something that may or may not exist in Workspace.
local debounce = false
function onTouched(hit) if debounce == false then debounce = true local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr and plr:IsInGroup(678906) then plr.Character:MoveTo(Vector3.new(4, 3, -139)) wait(3) end debounce = false end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 Jul 2013 10:09 PM |
| Oh, sorry. Also, try not to bump your topic until after it's no longer on the first page. Scripting Helpers isn't THAT active. xD |
|
|
| Report Abuse |
|
|