v6FiRE
(v6FiRE)
#1
i want to have my script only destroy a part for the client and not for other players but currently my script does nothing and gives no errors
here is my local script located in ServerScriptService:
game.Workspace.SpawnArea.SpawnDoor:Destroy()
this script will be disabled by default once working and will be enabled by another script
local scripts dont work in ServerScriptService, place the script in StarterPlayer → StarterPlayerScripts
1 Like
Valkyrop
(I_oL)
#3
Local scripts won’t run there.
Try to put it in StarterGui
.
Local Scripts
would run only in these places:
-StarterGui
-ReplicatedFirst
-StarterPlayerScripts
-StarterCharacterScripts
-Chat
Also, you should use WaitForChild
, because sometimes that part might hasnt loaded yet.
1 Like
LocalScripts do not run here.
Try using RunContext.
1 Like
v6FiRE
(v6FiRE)
#5
i have changed my script into this and moved it to ReplicatedFIrst
game.Workspace:WaitForChild("SpawnArea")
game.Workspace.SpawnArea.SpawnDoor:Destroy()
and it now works, ty
Valkyrop
(I_oL)
#7
Note that you should assign this as a variable. Like -
local SpawnArea = game.Workspace:WaitForChild("SpawnArea")