Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 08 Aug 2011 01:59 PM |
button = script.Parent wait() corpost = workspace.RegenStuff.Spawns[button.Name] button.BrickColor = corpost.BrickColor
function ontouch(hit) if hit == nil then return end if hit.Parent == nil then return end local find = hit.Parent:findFirstChild("Humanoid") if find ~= nil then local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent) if playerfind ~= nil then if playerfind.TeamColor == button.BrickColor then hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)
end end end end
button.Touched:connect(ontouch)
I checked and it has no errors (on output, anyhow)... But in my place it isn't working. |
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
| |
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
| |
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 09 Aug 2011 09:45 AM |
| Sorry about bumping a 1/2 day old thread, but I had to go somewhere irl yesterday. it took 5 and a half hours, and I still got no replies... >_> |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 09 Aug 2011 10:05 AM |
| For Every function or if, you need 1 end. As i can see there are 4 if's and 1 function. So you need 5 ends |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 09 Aug 2011 10:07 AM |
| Theres 5 if's and 1 function, so 6 end's |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:08 AM |
button = script.Parent wait() corpost = workspace.RegenStuff.Spawns[button.Name] button.BrickColor = corpost.BrickColor
button.Touched:connect(function(hit) if hit == nil then return end if hit.Parent == nil then return end local find = hit.Parent:findFirstChild("Humanoid") if find ~= nil then local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent) if playerfind ~= nil then if playerfind.TeamColor == button.BrickColor then hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0) end end end end end end) |
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 09 Aug 2011 10:14 AM |
@Dirk
Not helpful at all.
Read the script more carefully and you'll notice that if I do that the script will break. >_> |
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 09 Aug 2011 10:15 AM |
@biker
Same thing. The first 2 ifs are checking for nothing that is nil, and they have ends on those lines. Again, you're actually breaking the script by doing that. |
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
| |
|
|
| 09 Aug 2011 10:40 AM |
button = script.Parent wait() corpost = Workspace.RegenStuff.Spawns[button.Name] button.BrickColor = corpost.BrickColor
function ontouch(hit) if hit == nil then return end if hit.Parent == nil then return end local find = hit.Parent:findFirstChild("Humanoid") if find ~= nil then local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent) if playerfind ~= nil then if playerfind.TeamColor == button.BrickColor then hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)
end end end end
button.Touched:connect(ontouch)
|
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 09 Aug 2011 10:43 AM |
@Enzo
That's the same script >_>... |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:47 AM |
hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)
needs to be
hit.Parent.Torso.CFrame = corpost.CFrame * CFrame.new(0, 2.5, 0)
For some reason which I can't work out, you need to multiply CFrame values to get them to add. Probably due to the fact they have like, 12 values rather than 3, but meh. |
|
|
| Report Abuse |
|
|
Alex645ca
|
  |
| Joined: 02 Feb 2009 |
| Total Posts: 2531 |
|
|
| 09 Aug 2011 10:51 AM |
@Vortex
I know, why must CFrame rotations use 9 values rather than 3 (which CFrame.Angles does :P), I have no idea whatsoever... xD |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:57 AM |
| Neither do I, but I know the first 3 are position and the second 3 are angle and tilting. No idea what the third set of 3 is though :o |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 14 Aug 2011 10:14 AM |
| Sorry If I Didnt Help, Im Still A Sort Of Begining Scripter. So Thats What I Thought. |
|
|
| Report Abuse |
|
|