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: Why isn't this working?

Previous Thread :: Next Thread 
Lametta is online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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 is online. 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 is online. Lametta
Joined: 07 Jul 2012
Total Posts: 7302
27 Dec 2015 12:26 AM
Anyone else?
Report Abuse
Thelegender is not online. Thelegender
Joined: 04 May 2009
Total Posts: 6308
27 Dec 2015 12:52 AM
Does it work without FE?
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 12:59 AM
To clarify, what do you wish to accomplish through this script?
Report Abuse
Lametta is online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
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
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
27 Dec 2015 01:03 AM
The server gets mouse.hit.p
And tries to get the children of it?
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
27 Dec 2015 01:04 AM
o nvm sorry its 2am here lol
Report Abuse
Lametta is online. 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
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 01:09 AM
Since each player has a localscript, doing it normally should just about to do it.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 01:10 AM
just about do it*
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 01:10 AM
<--- Crappy grammar confirmed.
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
27 Dec 2015 01:11 AM
> model.Parent = game.Players.LocalPlayer

This will not replicate right?
Report Abuse
Lametta is online. Lametta
Joined: 07 Jul 2012
Total Posts: 7302
27 Dec 2015 01:11 AM
I'm confused...

Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 01:11 AM
It would put it in the player, but it would be visible therefore being useless.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
27 Dec 2015 01:12 AM
wouldn't*. Omfg I need to start proof reading my posts before posting them again.
Report Abuse
Thelegender is not online. Thelegender
Joined: 04 May 2009
Total Posts: 6308
27 Dec 2015 01:12 AM
Does it work without FE?
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
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
Thelegender is not online. Thelegender
Joined: 04 May 2009
Total Posts: 6308
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 is online. Lametta
Joined: 07 Jul 2012
Total Posts: 7302
27 Dec 2015 01:26 AM
Oh, then what do I do...?
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
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 is online. 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
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
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
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