digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 03:34 AM |
I have this small error, where my Spawn() function 'requires 1 argument' when it's already got an argument. Here's the affected parts:
function checkPressed(btn) btn.MouseButton1Down:wait() mouse = game.Players.LocalPlayer:GetMouse() clone = game.Lighting.insertParts[button.Text]:Clone() wait() clone.Parent = currcam clone.Transparency = 0.5 mouse.TargetFilter = clone dragging = true wait() while dragging do --set position until... wait() clone.Position = Vector3.new(math.floor(mouse.Hit.p.X), math.floor(mouse.Hit.p.Y), math.floor(mouse.Hit.p.Z)) wait() mouse.Button1Down:connect(--mouse down function() dragging = false clone.Parent = workspace clone.Transparency = 0 drg = true while drg do wait() mouse.Button1Up:connect(function() mouse.TargetFilter = nil drg = false end ) end end ) end end Spawn(checkPressed(button)) |
|
|
| Report Abuse |
|
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
|
| 02 Feb 2013 05:05 AM |
| We need to see what Spawn() is |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:19 AM |
| Spawn() basically does the same as coroutine.resume(coroutine.create()). |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:20 AM |
and Spawn() is a built in ROBLOX function.
http://wiki.roblox.com/index.php/Spawn()#Spawn |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2013 05:21 AM |
make sure spawn is written like this
Spawn = function(f) coroutine.resume(coroutine.create(function() f() end)) end |
|
|
| Report Abuse |
|
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:22 AM |
| I don't need to. It's a built in ROBLOX function. Read the link that I posted. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:23 AM |
Actually, Spawn() might not be what I'm looking for:
Executes function f after thread next yields. The function f is called with 2 arguments: The elapsed time and the current game time.
After thread next yields... But I could just do spawn(function) wait().. Hm. |
|
|
| Report Abuse |
|
|