Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Creating an insert/build tool for bricks with scripts?

Asked by 5 years ago

I haven't been on ROBLOX in a while and I see that some things have changed. I used to have a place with an insert/build tool that would clone bricks from Lighting and place them in Workspace. However, now inserting a brick with script inside (for example deadly on touch) doesn't work anymore. I guess this has something to do with server-client side (where could I read more about that?).

What would be the best way to create such a tool now? I tried using CollectionService and tag the bricks I clone, but it doesn't trigger GetInstanceAddedSignal (or maybe I am doing something wrong).

Thanks for your time. :)

0
this is basically a btools ripoff? cool xd DeceptiveCaster 3761 — 5y
1
accept overscores's answer m8 SaltyPotter 362 — 5y

1 answer

Log in to vote
2
Answered by 5 years ago

First of all, don't use Lighting as a place to store things anymore. If you need to store things on the client (the player's game), put them in the ReplicatedStorage. If you need to store them on the server, use the ServerStorage. The difference between the ReplicatedStorage and the ServerStorage is that the client and the server both have access to see the contents of the ReplicatedStorage, while only the server has access to the ServerStorage.

The reason the insert tool doesn't work anymore is because Roblox no longer replicates everything that the player changes anymore. For example, any player (client) could insert a part into Workspace before and it would clone it to the server and everybody else would see it. However, that is no longer the case. If the client makes a part and puts it in Workspace now, only that player will see it. So, when the player tries to insert the kill brick, the Script doesn't work because Scripts can only run on a server.

You should use RemoteEvents if you want to create an insert tool. On the client, have the tool call the remote event using :FireServer(argument). On the server, listen for .OnClientEvent(player, argument). Then create the object on the server, so that everyone can see it.

0
Thanks man! I've tried using Google and couldn't find such a great explanation. papalapa 7 — 5y
Ad

Answer this question