Lines of code being ignored?

I was making a dummy script and for some reason it seems like Roblox is just ignoring code. The cr variable is a clone of a humanoid in serverstorage. I don’t understand why it’s not working, the print doesn’t even work. There’s no errors, no warnings, nothing. I would think that if the clone simply didn’t exist, the print would throw an error, but that’s not the case. I tried everything I could think of, I moved the dummy to different locations, reloaded the dummy, I changed the variable name, the dummy name, etc. I’m genuinely dumfounded, the lines after the cr part work just fine. The ‘clone’ is copied to the workspace but the ‘cr’ isn’t. If anyone could help I’d really appreciate it since I have no clue.

local clone = script.Dummy:Clone()
local cr = game.ServerStorage.dummy:Clone()
print(cr.Name)
cr.Parent = game.Workspace
clone.Parent = game.Workspace

What type of script is this, and where is this script located?

It’s a server script in a gui, so startergui

Server scripts do not run inside of GUI, please change it to a LocalScript or change its RunContext | Documentation - Roblox Creator Hub

Also, what are you trying to do, changing this to LocalScript or Client will only clone the dummy for the one client it self, nobody else. If you want it to sync, you should be using Remote Events or Remote Functions, but again, be specific about what you are trying to do.

1 Like

its using a remote event not controlling the gui, its for an admin console

Can you please be specific about what this piece of code is doing or what overall you are trying to do, For an admin console,

  1. User enters command
  2. Textbox content is sent to the server via RemoteEvent
  3. Server executes the correct command

Yeah this script is executing the command, in this case the command is to create a dummy

Server scripts do have the ability to run in places like StarterGUI

Use module scripts, and have a module script for each command inside of your ServerStorage. Fire this event from a local script, and run the matching command’s module from the main script that is inside of ServerScriptService