Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
|
| 11 May 2014 06:07 PM |
function Click() mr = math.random(1,4) tors = script.Parent.Parent.Parent.Parent.Character.Torso if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click)
Can someone edit this I need those positions but it doesnt work |
|
|
| Report Abuse |
|
|
| |
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
| |
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 11 May 2014 06:32 PM |
from wat I see should be like this; -ScreenGui -- Classname --Frame -- Classname ---TextButton -- Classname
so its a GUI>Frame>Button>script |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 11 May 2014 06:40 PM |
I see the problem...
Going off of what KAAK said (the hierarchy) with the script in the TextButton, it should look like this:
function Click() mr = math.random(1,4) local game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
|
| 11 May 2014 06:44 PM |
Fox
function Click() mr = math.random(1,4)
local game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso
This line above has red underline...
if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click)
|
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 11 May 2014 06:56 PM |
If the script is TeleGui>Frame>Button>TeleScript
then:
local char = game.Players.LocalPlayer
function Click() mr = math.random(1,4) local tors = char.Character.Torso if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
| |
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
|
| 11 May 2014 08:32 PM |
| First one gets 200R Nothing Works Yet |
|
|
| Report Abuse |
|
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
| |
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 11 May 2014 11:06 PM |
wheres your connector line? theres for mousebutton1down but what connects it when the tool is equipped? (guessing that it is a tool)
you should have something like
function onEquippedLocal(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
and then this at the bottom
Tool.Equipped:connect(onEquippedLocal) |
|
|
| Report Abuse |
|
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 11 May 2014 11:08 PM |
| whoops, I look like an idiot again, only read OP, turns out its a GUI, so your not going to need the equipped function. sorry >_< |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 May 2014 11:09 PM |
| What do you mean "It doesn't work"? Is there an error code line? That would be very helpful. |
|
|
| Report Abuse |
|
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 11 May 2014 11:10 PM |
| Oooh, try turning it (the recently corrected script)from a script into a localscript. LocalPlayer is only available in localscripts |
|
|
| Report Abuse |
|
|
Coopertow
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 1959 |
|
| |
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 12 May 2014 12:37 AM |
plr=game.Players.localPlayer.Character; mr=math.random(1,4); script.Parent.MouseButton1Down:connect(function() if(mr==1)then plr:moveTo(CFrame.new(-502.238,1.38,322.261)); end; if(mr==2)then plr:moveTo(CFrame.new(-543.996,1.38,319.726)); end; if(mr==3)then plr:moveTo(CFrame.new(-548.895,1.38,234.437)); end; if(mr==4)then plr:moveTo(CFrame.new(-463.249, 1.38, 282.17)); end; end); |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 12:39 AM |
^
Ignore this guy, his # of # and # freaking semi-colons will drive you crazy. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 12:39 AM |
if this is good scripters only, why are you here? < BAHAHAHAHAHAHA ; i hav like no idea y i said that
this is a signature: pcall(function() print([[apparently this is a string]]) end) |
|
|
| Report Abuse |
|
|
| |
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 12 May 2014 01:52 AM |
| uh cooper, insert a new localscript, copy and paste your code into it, disable the script you copied from, and place the localscript where the script is. Tell me if it works now. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 12 May 2014 02:21 AM |
function Click() mr = math.random(1,4) Plyr = script.Parent repeat Plyr = script.Parent until Plyr.ClassName == "Player" tors = Plyr.Character.Torso if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click)
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 12 May 2014 02:22 AM |
| http://www.roblox.com/PAYMENT-item?id=155519626 |
|
|
| Report Abuse |
|
|
Foxconn
|
  |
| Joined: 20 Feb 2011 |
| Total Posts: 275 |
|
|
| 12 May 2014 05:38 PM |
ScreenGui>Frame>TextButton>Script It worked for me.
local char = game.Players.LocalPlayer
function Click() mr = math.random(1,4) local tors = char.Character.Torso if tors then if mr == 1 then tors.CFrame = CFrame.new(-502.238, 1.38, 322.261) elseif mr == 2 then tors.CFrame = CFrame.new(-543.996, 1.38, 319.726) elseif mr == 3 then tors.CFrame = CFrame.new(-548.895, 1.38, 234.437) elseif mr == 4 then tors.CFrame = CFrame.new(-463.249, 1.38, 282.17) end end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 12 May 2014 05:53 PM |
| cooper, I sent u a PM, read it and u'll get it fixed! |
|
|
| Report Abuse |
|
|