Hello! I’m making a button that spawns parts after I click it, but I was wondering if I could make parts spawn individually. Like parts will only spawn on a specific player’s screen instead of everyone’s screen.
Here’s my script:
Hello! I’m making a button that spawns parts after I click it, but I was wondering if I could make parts spawn individually. Like parts will only spawn on a specific player’s screen instead of everyone’s screen.
Here’s my script:
If you use a local script to make the parts the player that runs this script will be the only one who can see the part
i tried to replace the script with local script inside of “ServerScriptService”. But no part was spawned
you can’t run local scripts inside serverscriptservice instead you can create the part once you click the button
spawner.MouseButton1Click:Connect(function()
local part = Instance.new("Part")
part.Parent = workspace
end)
but wouldn’t the parts be visible to everybody? Because i want to spawn parts where it’s only visible to local players
It won’t be visible to everyone if its run on the local script, you can test this by switching to server mode in studio
In that case, where should i put the local script in?
You can place local scripts in guis or starterplayerscript currently your local script is in the correct place
You should look into how Replication works in Roblox. I’m going to give you a few articles and even some Youtube tutorials to help you learn.
EDIT: For clarification, these are to assist you in getting a fundamental understanding of replication, and networking on Roblox. These are REQUIRED skills in order to effectively write scripts in any game. Understanding the fundamentals, will further assist you in learning how to fix small issues like this. Based off your post it seems you’re an absolute beginner and in need of a push in the right direction rather than a direct solution to your issue. If you read any of these articles or learn the fundamentals of networking and replication you’ll be able to fix your issue on your own and future issues.
Low-Level Understanding of networking and replication is needed for this article.
https://www.youtube.com/results?search_query=Remote+events+roblox
local storage = game.ReplicatedStorage
local spawner = script.Parent
spawner.MouseButton1Click:Connect(function()
local part = Instance.new("Part")
part.Parent = workspace
end)
--put this in the localscript.
thank you so much for providing so many articles for me! I have a clear understanding of remote events now. Thank you!!!