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
-
A No One Survived server purchased at VolticHost.com
-
Access to VolticHost Game Panel
-
A basic text editor (e.g., Notepad, VS Code)
-
Familiarity with basic scripting concepts
1️⃣ Writing Your Custom Script
-
Open your preferred text editor.
-
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)
-
Save the file as npc_companion.lua on your computer.
✅ Custom script written and saved successfully!
2️⃣ Uploading Your Custom Script
-
Log in to VolticHost Game Panel.
-
Click on your No One Survived server.
-
Navigate to the File Manager.
-
Upload your npc_companion.lua file into a dedicated directory (e.g.,
NoOneSurvived/addons/npc_companions
). -
Verify that the file is present and accessible.
✅ Custom script uploaded successfully!
3️⃣ Integrating the Script into Server Startup
-
Navigate to the Startup tab in VolticHost Game Panel.
-
Append your startup command with the parameter to load your script, for example:
+exec npc_companion.lua
-
Click Save Changes to update your startup parameters.
✅ Server startup parameters updated to load the custom script!
4️⃣ Testing Your Custom Script
-
Navigate to the Console tab in VolticHost Game Panel.
-
Click Stop to shut down your server, then click Start to relaunch it with your script active.
-
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.