Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
|
| 26 Dec 2015 11:50 PM |
--[[SERVER SCRIPT]]--
script.Parent.Builder.OnServerEvent:connect(function(p,...) Get = p:GetChildren() for i = 1,#Get do if Get[i].ClassName == "Model" then x = Get[i]:clone() Get[i]:Destroy() wait() x.Parent = game.Workspace.AddedItems x:MoveTo(...) end end end)
--[[ PART OF THE LOCAL SCRIPT ]]--
function onButton1Up(mouse) keys() wait() model.Parent = game.Players.LocalPlayer local pos = mouse.hit.p game.Workspace.GAMEQ.Builder:FireServer(pos) wait() script.Parent:Destroy() end |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2015 11:53 PM |
| If your wondering why the model (in the localscript) won't appear is because your putting it on the player in players. This means it will not appear in workspace therefore not being visible. |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
|
| 26 Dec 2015 11:55 PM |
| I'm using filtering enabled, so I can't put it directly in workspace. I tried to put it into the player and fire he event to access the player. Then I was going to have the server script put it in workspace. |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
| |
|
| |
|
|
| 27 Dec 2015 12:59 AM |
| To clarify, what do you wish to accomplish through this script? |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
|
| 27 Dec 2015 01:00 AM |
| Copy and paste something from a local script to a server script, so that the server could place the object. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:02 AM |
| So you want a model/part which is located inside the localscript to be cloned and moved to a script in lets say serverscriptservice, then the script in serverscriptservice will insert it into workspace? |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:03 AM |
The server gets mouse.hit.p And tries to get the children of it?
|
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:04 AM |
| o nvm sorry its 2am here lol |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
|
| 27 Dec 2015 01:08 AM |
Sort of, Advanced.
The local script is taking a model that's inside of a tool. Then I need a serverscript to copy it.
But basically, yes, what you said. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:09 AM |
| Since each player has a localscript, doing it normally should just about to do it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Dec 2015 01:10 AM |
| <--- Crappy grammar confirmed. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:11 AM |
> model.Parent = game.Players.LocalPlayer
This will not replicate right? |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
| |
|
|
| 27 Dec 2015 01:11 AM |
| It would put it in the player, but it would be visible therefore being useless. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:12 AM |
| wouldn't*. Omfg I need to start proof reading my posts before posting them again. |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Dec 2015 01:13 AM |
| @OP Try start server with one player. When the script breaks, check and see if everything is there from the client's explorer window. Then go check the server's. Pretty sure the server cant see that model you are putting into the player object. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:16 AM |
Yeah, the server can not access player's children with FE.
So if it does work without FE, then that's your only problem. |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
| |
|
|
| 27 Dec 2015 01:37 AM |
Well, any instance created by the client can't be seen by the server. Assuming this is some sort of build tool, you'll wanna make some sort of ID for each model you have. Pass that with the position. The server will have to create the object again.
Or, have the server put the obj in ReplicatedStorage before the client screws around with it. Have the client screw with it and when the server goes to place it, its already been copied. Yay! |
|
|
| Report Abuse |
|
|
Lametta
|
  |
| Joined: 07 Jul 2012 |
| Total Posts: 7302 |
|
|
| 27 Dec 2015 01:47 AM |
Can the client mess with stuff in replicatedstorage? like idk
:clone().Parent = game.ReplicatedStorage
??? |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2015 01:57 AM |
| The client can mess with only its own copy of ReplicatedStorage. To go from client to server, you must send absolutely everything via remote event or function. |
|
|
| Report Abuse |
|
|