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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|