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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: local script that gets cloned into a players backpack

Previous Thread :: Next Thread 
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 08:32 PM
that does not work in online mode but works in solo... wth I thought that if this happened it only happened with non local scripts... how do i fix it...? (should i post the 59 line script?)
Report Abuse
Xlaive is not online. Xlaive
Joined: 25 Aug 2012
Total Posts: 97
30 Sep 2012 08:34 PM
Try putting wait(5) at the top.
Report Abuse
3DShooter is not online. 3DShooter
Joined: 04 Aug 2010
Total Posts: 976
30 Sep 2012 08:44 PM
please post the script.
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 08:47 PM
--the cc and lp variables are like that because i originally had this as a reg script and it didnt work, i think all the variables are correct as this works in solo but i have no idea if it really does...


print("lul")
local CC=game.Workspace.CurrentCamera
--repeat wait() until CC.Player.Value~=""
wait(5)
local LP=game.Players.LocalPlayer.Name

for i=1,3 do
spot=CC.Nook1["Nook's Cranny"]["Spot"..(tostring(i))]
if game.Players[LP][spot.Name].Value~="" and game.Players[LP].Time.Day.Value==game.Players[LP].PlayerGui.Clock.Digital.Day.Value then
local a=game.Lighting.ShopItems.Square1Items[game.Players.LP.spot.Value]:Clone()
a.Parent=workspace.CC.Nook1
if a.ClassName=="Model" then
a:MoveTo(script.Parent.Position)
elseif a.ClassName=="Tool" then
local lol=Instance.new("Model")
lol.Name=a.Name
lol.Parent=CC.Nook1
local b=a:GetChildren()
spot.Item.Value=a.Name
for i=1,#b do
if c:IsA("BasePart") then
c.Parent=lol
c.Anchored=true
c.CanCollide=false
else
c:Destroy()
end
end
lol:MoveTo(spot.Position)
end
else
local a= game.Lighting.ShopItems.Square1Items:GetChildren()
local num=math.random(1,#a)
local thing=a[num]:Clone()
spot.Item.Value=thing.Name
if thing.ClassName=="Model" then
thing.Parent=CC.Nook1
thing:MoveTo(spot.Position)
elseif thing.ClassName=="Tool" then
local lol=Instance.new("Model")
lol.Name=thing.Name
lol.Parent=CC.Nook1
local b=thing:GetChildren()
for i=1,#b do
local c=b[i]:Clone()
if c:IsA("BasePart")==true then
c.Parent=lol
c.Anchored=true
c.CanCollide=false
else
c:Destroy()
end
end
lol:MoveTo(spot.Position)
end
game.Players[LP][spot.Name].Value=thing.Name
end
end
Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
30 Sep 2012 08:53 PM
It has to be a localscript, no?
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 08:55 PM
yes because it is accessing things in the CurrentCamera.
Report Abuse
3DShooter is not online. 3DShooter
Joined: 04 Aug 2010
Total Posts: 976
30 Sep 2012 08:57 PM
Any output? A description of what it is supposed to do may help as well.
Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
30 Sep 2012 08:58 PM
Local scripts produce no outputs
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:00 PM
no ouput according to roblox's GUI ouput (in solo there is also no ouput but it works in solo), it is getting shop items out of lighting and putting them on Spot1, Spot2, and Spot3. before it gets the items it checks if you have been there that day (saves the day and what you last had in the shop when you entered) then it will have the same things as when you were there earlier, if you have not been there that day it will randomly choose items.
Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
30 Sep 2012 09:02 PM
So what is the line 59 or whatever?
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:03 PM
I was asking if i should post it because it was 59 lines long
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
30 Sep 2012 09:03 PM
LocalScripts do produce output.
Report Abuse
crusada91 is not online. crusada91
Joined: 04 Sep 2010
Total Posts: 684
30 Sep 2012 09:06 PM
Ohhk, so add a instead of print, instance.new message to check where things mess up?>
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:08 PM
how would I have the message text show output of the script?
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
30 Sep 2012 09:11 PM
Test > Start Server
wait 'til server starts (This is in Studio)
Test > Start Player
(Make sure output is open, and test it from there.)
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:12 PM
^I believe that is the same as doing play solo in terms of local script/non local script glitches but I will see if it gives ouput....
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
30 Sep 2012 09:14 PM
Alrighty..
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:22 PM
in StartServer>Start Player it works just like in play solo but it does not work in multiplayer
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:48 PM
I fixed it
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 09:52 PM
*facepalm* nevermind I just was accidentally testing in studio instead of multiplayer
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
30 Sep 2012 09:52 PM
K!
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
30 Sep 2012 10:30 PM
i fixed it.... i hope...
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