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: Server Client Interaction & Data Transfer

Previous Thread :: Next Thread 
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 06:25 PM
Why does this work in build mode but not server mode?

script 1 (workspace.Script1):

function f()
print("Function Working")
end

game.Workspace.ChildAdded:connect(function(c)
if c.Name == "RunFunction" then
f()
end
end)


script 2 (workspace.CurrentCamera.Script2 (Yes, this script is in the current camera in server mode. Unless you have a reason why a regular script wont run in the CurrentCamera, then don't comment on how "Blah blah blah, camera can't be accessed in server mode without a local script! blah blah blah Thank you.")):

sv=Instance.new("StringValue")
sv.Name = "RunFunction"
sv.Parent = workspace
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 06:43 PM
BUMP
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
26 Aug 2011 07:09 PM
Script 2 is probably running first OR creating the object faster than script 1 has time to create the event. Therefore, the event connection never catches the new object. Add like a 'wait(0.1)' or something to script2.
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 08:04 PM
Well, the two scripts I posted were examples scripts for my more complex scripts. Can you please look over my real two scripts? Keep in mind that they only not work in server mode.:

Script 1 (workspace.CurrentCamera.ElevatorDoors):


DoorsService = workspace.DoorsService

delay(0,function()

DoorsService.ChildAdded:connect(function(c)

if c.Name == "FloorOpen1" then
if c.Value == script.Parent.FloorNumber.Value then
da = script.Parent.Door1a
db = script.Parent.Door1b

for i = 1,100 do
da.CFrame = da.CFrame + Vector3.new(0,0,-.2)
db.CFrame = db.CFrame + Vector3.new(0,0,.2)
wait()
end

end
end

end)
end)


Script 2 (workspace.Elevator.Script):

iv=Instance.new("IntValue")
iv.Name = "FloorOpen1"
iv.Value = FloorNumber
iv.Parent = workspace.DoorsService
game:GetService("Debris"):AddItem(iv,.5)
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 08:27 PM
BUMP
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 09:21 PM
Bring Up My Post
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
26 Aug 2011 09:45 PM
Some help would be appreciated.
Report Abuse
TheNewFissy is not online. TheNewFissy
Joined: 03 Jan 2011
Total Posts: 1301
27 Aug 2011 11:33 AM
bump
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