generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Function, Loadstring, and Return error

Previous Thread :: Next Thread 
Vrakner is not online. Vrakner
Joined: 19 Feb 2013
Total Posts: 323
31 Jul 2013 03:59 AM
Script:

function RunCoding(code)
clone = ScriptsGroup.zzzGUIDEzzz.RunScript:Clone() --this script runs the code in Source
clone.Parent = script
clone.Name = "CodeGo"
clone["Source"].Value = code
clone.Disabled = false
return clone --this is what I'm not sure about
end

Error:

01:56:03.577 - An error occurred
01:56:03.579 - Script "Players.Player1.PlayerGui.Scripts.GunSwitchingScript.Machin", Line 101 - global RunCoding
01:56:03.582 - Script "Players.Player1.PlayerGui.Scripts.GunSwitchingScript.Machin", Line 251 - global OnFire
01:56:03.584 - Script "Players.Player1.PlayerGui.Scripts.GunSwitchingScript.Machin", Line 414
01:56:03.587 - stack end


What is wrong here? For reference, I'm calling the function with this:

local CoroutinesSk = RunCoding([[
MyPlayer = game.Players.LocalPlayer
ScriptsGroup = MyPlayer.PlayerGui.Scripts

repeat wait() until ScriptsGroup.ArmsFollowScreen.LeftArmRotation.Value
local LAR = ScriptsGroup.ArmsFollowScreen.LeftArmRotation.Value
repeat wait() until ScriptsGroup.ArmsFollowScreen.LeftArmPosition.Value
local LAP = ScriptsGroup.ArmsFollowScreen.LeftArmPosition.Value
repeat wait() until ScriptsGroup.ArmsFollowScreen.RightArmRotation.Value
local RAR = ScriptsGroup.ArmsFollowScreen.RightArmRotation.Value
repeat wait() until ScriptsGroup.ArmsFollowScreen.RightArmPosition.Value
local RAP = ScriptsGroup.ArmsFollowScreen.RightArmPosition.Value

for i=1, 3 do
wait(FireRate/6)
RAP = RAP - Vector3.new(0,0,0.02)
end
for i=1, 3 do
wait(FireRate/6)
RAP = RAP + Vector3.new(0,0,0.02)
end

script:Destroy() --haha
]])
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
31 Jul 2013 04:22 AM
you can't access Source property
Report Abuse
Vrakner is not online. Vrakner
Joined: 19 Feb 2013
Total Posts: 323
31 Jul 2013 04:40 PM
Source is a stringvalue in the clone.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
31 Jul 2013 04:44 PM
RBX.Lua checks members before children; rename Source
Report Abuse
Vrakner is not online. Vrakner
Joined: 19 Feb 2013
Total Posts: 323
31 Jul 2013 08:17 PM
Got it, thanks.

Stupid ROBLOX wiki...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image