I have a script inside a part in the server storage where it checks for when it's parent is changed, and if the parent is the workspace it explodes. But whenever I clone the part and parent it to the workspace, it wont explode or do anything, the script doesn't run properly.
local part1 = game.ServerStorage:FindFirstChild("Part"):Clone() part1.Parent = game:GetService("Workspace")
Do scripts in cloned parts work?
print("Hello trecept!")
I believe I know the answer to your problem.
The problem first of all, is I would need to see all of the code to figure out what happens.
The second problem is, which happened to me a lot, is calling the initial clone. You shouldn't make a variable to have a clone call.
local part1 = game.ServerStorage.Part part1:Clone().Parent = workspace
Note the above named "Part" should be named what ever your part is named during the initial grabbing of the part :P
What the variable states, is the location of the part in server storage, and the :Clone() line also states the parent of the part.
Now just in case that doesn't work(Which it should, I have tested it in Roblox Studio), you can try using RemoteEvents. Which allow you to connect code to another parts of code, whenever the event is fired. For a quick run down on how remote Events works, let's say I have this script:
local hi = workspace.Camera local event = game.ReplicatedStorage.hiEvent
(Note that this script is server side, more detail on that) To cast that event, I would just put:
event:FireClient(argument/variable)
To receive that event, you would need a local script stating a variable of the event
local event = game.ReplicatedStorage.hiEvent event.OnServerEvent:Connect(function(parameter/arguement) print("hi") end)
Now only use Remote events if the cloning doesn't work.
If you need more assistants with this, be sure to ping me on social media(preferable discord) so I can continue with this problem!
Hope this helps!
Good luck and script on!;
Aspiring developer: Creep(Creeperthekid32)
Discord: Creep#7611 Twitter: @creeperthekid32 Roblox: Creeperthekid32