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: Client-side Massive Particles!

Previous Thread :: Next Thread 
Foboh is not online. Foboh
Joined: 24 Nov 2010
Total Posts: 128
21 Mar 2014 08:24 PM
I want to use a local script to spawn a massive amount of tiny bricks that act as particles so the physics won't be calculated on a server. I plan to have an option to turn these particles off for slower computers.

My script here works in a regular server script, but not a local script. I don't know if there are just some things you can and can't do with local scripts.

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then

local ParticleModel = game.ServerStorage.TestModel:Clone()
ParticleModel.Parent = game.Workspace

print("made a bunch of bricks")


end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
21 Mar 2014 08:25 PM
Where is the LocalScript placed? They only function in the Backpack, the character, and the PlayerGui.
Report Abuse
Foboh is not online. Foboh
Joined: 24 Nov 2010
Total Posts: 128
21 Mar 2014 08:27 PM
I didn't know that... it's just placed in the Workspace. Can I put it in the backpack?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
21 Mar 2014 08:29 PM
Yeah. Just put it in the StarterPack and it should work fine.
Report Abuse
Foboh is not online. Foboh
Joined: 24 Nov 2010
Total Posts: 128
21 Mar 2014 08:35 PM
How do I make it start when a brick is touched?
Report Abuse
Foboh is not online. Foboh
Joined: 24 Nov 2010
Total Posts: 128
21 Mar 2014 08:38 PM
Nevermind! I did it. The last line should be game.Workspace.SmoothBlockModel.Touched:connect(onTouch)
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
21 Mar 2014 08:38 PM
game.ServerStorage.TestModel:Clone()


Clients can't see ServerStorage. Move your TestModel to ReplicatedStorage instead.
I don't think you can use the Touched event from a LocalScript either, but you can use a Touched event on the server, then fire a RemoteEvent from the server, and the client will be able to see THAT.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
21 Mar 2014 09:19 PM
agent, you're my favorite person on this forum lol
-=Robo=-
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