Home No One Survived Creating and Uploading Custom Scripts on Your No One Survived Server

Creating and Uploading Custom Scripts on Your No One Survived Server

Last updated on Feb 19, 2025

Learn how to write a simple custom script from scratch and upload it to your No One Survived server, giving you a functional starting point for further customization.


📌 Prerequisites


1️⃣ Writing Your Custom Script

  1. Open your preferred text editor.

  2. Create a new file and paste the following sample code, which spawns an NPC companion when a player spawns:

    -- npc_companion.lua
    -- This script spawns an NPC companion for a player if they don't already have one.
    
    function spawnCompanion(player)
        if not player.hasCompanion then
            local companion = spawnNPC("Companion", player.getPosition())
            companion.follow(player)
            player.hasCompanion = true
            print("Companion spawned for " .. player.name)
        end
    end
    
    -- Register the spawnCompanion function to trigger when a player spawns
    registerEvent("playerSpawn", spawnCompanion)
    
  3. Save the file as npc_companion.lua on your computer.

Custom script written and saved successfully!


2️⃣ Uploading Your Custom Script

  1. Log in to VolticHost Game Panel.

  2. Click on your No One Survived server.

  3. Navigate to the File Manager.

  4. Upload your npc_companion.lua file into a dedicated directory (e.g., NoOneSurvived/addons/npc_companions).

  5. Verify that the file is present and accessible.

Custom script uploaded successfully!


3️⃣ Integrating the Script into Server Startup

  1. Navigate to the Startup tab in VolticHost Game Panel.

  2. Append your startup command with the parameter to load your script, for example:

    +exec npc_companion.lua
    
  3. Click Save Changes to update your startup parameters.

Server startup parameters updated to load the custom script!


4️⃣ Testing Your Custom Script

  1. Navigate to the Console tab in VolticHost Game Panel.

  2. Click Stop to shut down your server, then click Start to relaunch it with your script active.

  3. Join a test session to verify that the NPC companion spawns when a player spawns, and check the console for confirmation messages.

Custom script is active and functioning on your No One Survived server!


🎉 Conclusion

You've successfully created and uploaded a custom script on your No One Survived server using VolticHost Game Panel, providing a solid foundation to expand and customize your server functionality. 🚀

For additional assistance, contact VolticHost Support.