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 » Scripters
Home Search
 

Re: Sending objects from server to client?

Previous Thread :: Next Thread 
ByDefault is not online. ByDefault
Joined: 25 Jul 2014
Total Posts: 3197
19 Aug 2016 12:51 PM
Is this possible using RemoteFunctions? I have a model stored in ServerStorage, and want to send it to the client through a RemoteFunction

--Server
function bla.OnServerInvoke(player)
player.bla:InvokeClient(model:Clone())
end

--Client
local model

bla:InvokeServer()

fuction bla.OnClientInvoke(mod)
print(mod) --> prints nil
model = mod
model.Parent = workspace
end
Report Abuse
UFAIL2 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
19 Aug 2016 12:54 PM
It says on the wiki that isn't: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial#Limitations

Store it in ReplicatedStorage as that's the use of it. ServerStorage is for the server.
Report Abuse
ByDefault is not online. ByDefault
Joined: 25 Jul 2014
Total Posts: 3197
19 Aug 2016 12:58 PM
But I only want the receiving player to have access to the model, and putting it in ReplicatedStorage would replicate it to all clients when I put the model in (?).
Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
19 Aug 2016 01:00 PM
How would it prevent you from explicitly giving it to another player?

Are you not willing to write any backend whatsoever?
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
19 Aug 2016 01:04 PM
If you're afraid that some clients can clone the objects to workspace without permission, you can always use keys

ex:

function re.OnServerInvoke(player,request)
if request = "sjfkb1b23jee" then
game.ReplicatedStorage.Model:Clone().Parent = workspace
end
end


This siggy is copyrighted ©
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
19 Aug 2016 01:13 PM
i do this for my weapon system

i invoke the server to make a projectile server side via cloning from server storage, then i return that value back to the client to make it invisible on their client

so i think your answer is, it should work


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
alij12 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
19 Aug 2016 01:14 PM
or

you could use InsertService w/ remote functions.
Report Abuse
Objectly is not online. Objectly
Joined: 18 Jul 2016
Total Posts: 210
19 Aug 2016 01:14 PM
Let the server handle parenting the model.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
19 Aug 2016 01:16 PM
"Let the server handle parenting the model."

i forgot to mention this, you can parent it on the server then return the model to the client


Formerly xXTheRobotXx, add 13,349 posts
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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