### QuestHandler Start() Implementation Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components Example of the Start() function in a component, used for executing gameplay logic after the service has started. ```lua -- Components/Others/QuestHandler.lua local QuestHandler = {} function QuestHandler.Init() -- Setup code end function QuestHandler.Start() -- Runs after service starts -- Safe to run gameplay logic here QuestHandler:LoadActiveQuests() end function QuestHandler:LoadActiveQuests() -- Implementation end return QuestHandler ``` -------------------------------- ### Project file structure example Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure A comprehensive example of how to organize services, accessors, mutators, and utility components. ```text src/ServerSource/Server/ ├── PlayerSystems/ │ ├── PlayerDataService/ │ │ ├── init.lua │ │ ├── Accessor.lua │ │ ├── Mutator.lua │ │ └── Others/ │ │ ├── DataValidator.lua │ │ └── DataMigration.lua │ └── PlayerStatsService/ │ ├── init.lua │ ├── Accessor.lua │ ├── Mutator.lua │ └── Others/ │ └── StatCalculator.lua ├── EconomySystems/ │ ├── ShopService/ │ │ ├── init.lua │ │ ├── Accessor.lua │ │ ├── Mutator.lua │ │ └── Others/ │ │ ├── PriceCalculator.lua │ │ └── DiscountManager.lua │ └── CurrencyService/ │ ├── init.lua │ ├── Accessor.lua │ └── Mutator.lua └── CombatSystems/ ├── DamageService/ │ ├── init.lua │ ├── Accessor.lua │ ├── Mutator.lua │ └── Others/ │ └── DamageCalculator.lua └── EffectsService/ └── init.lua << Simple service, no Accessor/Mutator needed ``` -------------------------------- ### RegisterClientSignal usage example Source: https://docs.superbulletstudios.com/superbullet-knit/dynamic-remotes Example of registering a signal in a component's Init function and connecting to it. ```lua -- In a component's Init() function: local QuestService = Knit.GetService("QuestService") Knit.RegisterClientSignal(QuestService, "OnQuestComplete"):Connect(function(player, questId) print(player.Name, "completed quest", questId) end) ``` -------------------------------- ### Example error initialization warning Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components A sample warning message logged by the system when a component's Init() or Start() function fails. ```text Error initializing component ServerScriptService.MyService.Components.Others.BrokenComponent: attempt to index nil ``` -------------------------------- ### Parent system communication example Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Shows how parent systems can call each other freely, with examples of PointsService calling ProfileService and ShopService calling PointsService. ```lua -- PointsService can call ProfileService local ProfileService = Knit.GetService("ProfileService") local playerProfile = ProfileService:GetProfile(player) -- ShopService can call PointsService local PointsService = Knit.GetService("PointsService") PointsService:AddPoints(player, purchaseReward) ``` -------------------------------- ### RegisterClientMethod usage example Source: https://docs.superbulletstudios.com/superbullet-knit/dynamic-remotes Example of registering a method in a component's Init function and defining its OnServerInvoke handler. ```lua -- In a component's Init() function: local QuestService = Knit.GetService("QuestService") Knit.RegisterClientMethod(QuestService, "GetActiveQuests").OnServerInvoke = function(self, player) return QuestManager:GetPlayerQuests(player) end ``` -------------------------------- ### RegisterClientProperty usage example Source: https://docs.superbulletstudios.com/superbullet-knit/dynamic-remotes Example of registering a property in a component's Init function and updating it using :Set(). ```lua -- In a component's Init() function: local GameService = Knit.GetService("GameService") local configProp = Knit.RegisterClientProperty(GameService, "GameConfig", { MaxPlayers = 10, RoundTime = 300, }) -- Later, you can update it: configProp:Set({ MaxPlayers = 20, RoundTime = 600 }) ``` -------------------------------- ### Example prompt for referencing existing games Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices Use this pattern to help the AI understand your vision by referencing existing games or systems. The examples are placeholders; replace them with your own references. ```text "Similar to the sword fighting in 'Blox Fruits' but with..." "Like the building system in 'Welcome to Bloxburg' but simplified..." "Based on the movement in 'Super Mario Bros' but in 3D..." ``` -------------------------------- ### Responsive Design Scale vs Offset Examples Source: https://docs.superbulletstudios.com/prompt-engineering/making-user-interface Examples demonstrating the difference between mixed scale/offset values and pure scale values for responsive UI design. ```lua Size = UDim2.new(0.1, 25, 0.2, 50) ``` ```lua Size = UDim2.new(0.1, 0, 0.2, 0) ``` -------------------------------- ### Complete Service and Component Implementation Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components A full example showing a service initialization, an accessor component, and a feature handler component. ```lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local Knit = require(ReplicatedStorage.Packages.Knit) local MyService = Knit.CreateService({ Name = "MyService", Client = {}, Instance = script, }) function MyService:KnitStart() -- Components are now available print("Components loaded:", self.Components) -- Use the Accessor if self.Accessor then local data = self.Accessor:GetSomeData() end end function MyService:KnitInit() -- Get other services end return MyService ``` ```lua local Accessor = {} function Accessor:GetSomeData() return { key = "value" } end return Accessor ``` ```lua local ReplicatedStorage = game:GetService("ReplicatedStorage") local Knit = require(ReplicatedStorage.Packages.Knit) local FeatureHandler = {} function FeatureHandler.Init() print("FeatureHandler initializing") -- Can register client items here local MyService = Knit.GetService("MyService") Knit.RegisterClientSignal(MyService, "FeatureEvent") end function FeatureHandler.Start() print("FeatureHandler started") -- Runtime logic end return FeatureHandler ``` -------------------------------- ### Reference Path Prompt Example Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths A practical application of the reference path template for a team-based spawning system. ```text "Using this reference path from Roblox Studio: ['Workspace.GameArena.SpawnPoints.TeamASpawn'] Create a team-based spawning system that randomly selects from available spawn points and prevents spawn camping. Additional context: - 5v5 team battles - Spawn protection for 3 seconds - Visual spawn effect with particles" ``` -------------------------------- ### Bug Fix Prompt Example Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug A concrete example of how to fill out the bug fix template for a jump pad system issue. ```text FIX: Jump Pad System - Players not launching Error: No upward velocity applied when stepping on pad, no error messages in console Expected: Players should launch 50 studs upward with trail effect When: Happens with all players on all jump pads Fix needed: Debug the velocity application and add visual feedback ``` -------------------------------- ### Real Bug Report Example Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug A concrete example of a bug report detailing a respawn system failure. ```text BUG FIX REQUEST: Original feature: Player respawn system that teleports dead players to random spawn points after 5 seconds Current problem: Players respawn immediately at (0,0,0) instead of spawn points. No 5-second delay occurs. Error in output: 'ReplicatedStorage.SpawnData is not a valid member of ReplicatedStorage' Expected behavior: 5-second countdown, then teleport to one of 8 designated spawn points randomly Context: Happens every time any player dies from fall damage or combat Additional info: Using FilteringEnabled, spawn points are in workspace folder called 'SpawnPoints' Please fix this issue and explain what was wrong. ``` -------------------------------- ### QuestHandler Init() Implementation Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components Example of the Init() function in a component, used for registering client signals and retrieving service references before KnitStart(). ```lua -- Components/Others/QuestHandler.lua local QuestHandler = {} function QuestHandler.Init() -- Runs during component initialization phase local QuestService = Knit.GetService("QuestService") -- Register dynamic client items here Knit.RegisterClientSignal(QuestService, "OnQuestUpdate") end return QuestHandler ``` -------------------------------- ### Version Compatibility Configuration Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features An example prompt requesting an optional feature that can be toggled via a configuration setting. ```text Add new spell casting to my magic system, but make it optional so servers can enable/disable it via a configuration setting in ServerStorage. ``` -------------------------------- ### Direct Game Link Example Source: https://docs.superbulletstudios.com/publishing-roblox-game A sample URL format for a published Roblox game. ```text https://www.roblox.com/games/14714119542/Hop-On-2-Player-Obby ``` -------------------------------- ### Simple Feature Addition Prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts for adding simple features to an existing system. ```text "Add player level calculation to the existing system" "Add cooldown tracking for player actions" "Create a backup system for player data" ``` -------------------------------- ### Data Migration Specification Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features An example prompt defining how to handle existing player data when adding new fields like XP and Level. ```text Add "XP" and "Level" fields to my player data system. For existing players without these fields: - Set XP = 0 - Set Level = 1 - Update the data structure automatically on login ``` -------------------------------- ### AI Prompt for UI Planning Source: https://docs.superbulletstudios.com/prompt-engineering/making-user-interface Example prompt to request a structured UI layout plan from an AI assistant. ```text "Help me plan a main menu layout for my Roblox racing game. I need: - A title at the top - Play, Settings, and Quit buttons - A background that fits the racing theme - Mobile-friendly touch targets What should the structure and styling look like?" ``` -------------------------------- ### Feature Addition Example: Item Enchanting Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features A concrete example of applying the feature addition template to an item enchanting system. ```text ADD FEATURE: Item enchanting to Combat system CURRENT SYSTEM: - Purpose: Sword combat with damage calculation - Architecture: Tools in StarterPack, RemoteEvent "DealDamage" - Data: Weapon stats stored in Tool attributes NEW FEATURE: - Functionality: Add magical enchantments to weapons - Integration: Extend current damage calculation with enchant bonuses - UI: Add enchanting interface to existing weapon inspection CONSTRAINTS: - Compatibility: All existing weapons must work unchanged - Performance: No lag during combat calculations - Security: Server-side enchantment validation TESTING: Verify enchanted and normal weapons both work in combat ``` -------------------------------- ### Providing Context for Feature Requests Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features An example of how to frame a feature request by summarizing the existing system's architecture before proposing changes. ```text I have an existing player inventory system that stores items in ReplicatedStorage.PlayerData with Name, Quantity, Rarity, and Icon properties. It uses RemoteEvent "UpdateInventory" for sync and supports 20 items maximum. Add a new feature: Item categories (Weapons, Tools, Consumables) with filtering UI. ``` -------------------------------- ### Complex Feature Addition Prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts for adding complex, multi-faceted systems. ```text "Add a complete friend system with friend requests, acceptance, and friend lists" "Implement a guild system with member management and permissions" "Create an auction house system for player trading" ``` -------------------------------- ### Token Usage Comparison: With Reference Paths Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths An example of a low-token usage interaction where the user provides an exact reference path, allowing the AI to target the script immediately. ```text User: "Using this reference path from Roblox Studio: ['ServerScriptService.PlayerSystems.HealthManager'] Add a health regeneration system that restores 5 HP every 2 seconds when players aren't in combat." AI: [Immediately provides solution targeting the exact script] ``` -------------------------------- ### Server-only system prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts for systems that run exclusively on the server for logic and security. ```text "Create a server-only player data service that saves stats to DataStore" "Build a backend damage calculation system with anti-cheat validation" "Make a server-side economy service for handling purchases" ``` -------------------------------- ### Adding New Features or Components Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts for adding new features or components to existing services. ```text "Add a new feature to track player achievements in the PlayerDataService" "Create a discount system for the ShopService" "Add validation logic for player usernames" ``` -------------------------------- ### Player HUD UI System Example Source: https://docs.superbulletstudios.com/prompt-engineering/making-user-interface A practical application of the UI System Template for a Player HUD, detailing structure, responsiveness, and performance considerations. ```text UI SYSTEM: Player HUD STRUCTURE: - ScreenGui: "PlayerHUD" - TopBar Frame (health, mana, minimap) - HotbarFrame (item shortcuts) - ChatFrame (communication) RESPONSIVE DESIGN: - Desktop: Full HUD with all elements visible - Mobile: Collapsed HUD with expandable sections FUNCTIONALITY: - Real-time health/mana updates via RemoteEvents - Drag-and-drop hotbar item assignment - Minimap with player position tracking PERFORMANCE: - Update HUD elements max 30fps to preserve performance - Use object pooling for damage numbers - Optimize minimap rendering for mobile devices TESTING: - Verify HUD scales properly on all supported resolutions - Test touch interactions on mobile devices - Validate data sync during high server load ``` -------------------------------- ### Correct Refactoring Prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts that correctly target a single component for refactoring to ensure high success rates. ```text "Refactor ONLY ONE component from this PlayerDataService. ONLY ONE." "Refactor ONLY the LARGEST COMPONENT from the Accessor component. ONLY ONE." "Refactor ONLY the LARGEST COMPONENT from the Mutator component. ONLY ONE." "Extract ONLY the validation logic into a separate component. ONLY ONE." "Move ONLY the price calculation logic into its own component. ONLY ONE." "Refactor ONLY the UI handling part of this InventoryController. ONLY ONE." ``` -------------------------------- ### Prompt context examples for Roblox games Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices Use these prompt starters to provide game context before requesting features. They help the AI understand the game's genre and setting. ```text "For my medieval RPG game, create a quest system that..." "In my racing game, I need a lap timer that..." "For my horror survival game, build an inventory system that..." ``` -------------------------------- ### Backwards Compatibility Specification Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features An example prompt specifying that new functionality must not break existing single-player respawn logic. ```text Add team-based respawning to my current respawn system. CRITICAL: Existing single-player respawn must continue working unchanged for players not on teams. ``` -------------------------------- ### Example progression of prompts for a jump pad Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices Iterate from basic functionality to edge cases. This sequence shows how to refine a prompt for a jump pad, adding features and safety checks progressively. ```text 1. "Create a basic jump pad that launches players upward" 2. "Add particle effects and sound to the jump pad" 3. "Make the jump force configurable for different pad types" 4. "Add safety checks to prevent exploitation" ``` -------------------------------- ### Avoid blocking operations in KnitInit Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization An anti-pattern example showing operations like DataStore calls and task.wait inside KnitInit, which should be avoided. ```lua function MyService:KnitInit() -- Never put operations in KnitInit! self.DataStore = DataStoreService:GetDataStore("PlayerData") local data = self.DataStore:GetAsync("PlayerData") self.Players = {} task.wait(5) end ``` -------------------------------- ### Chain Prompts Effectively Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices Example of chaining prompts to build on previous work, such as creating a matching ammo system after a weapon system. ```text "Based on the previous weapon system, now create a matching ammo system that..." ``` -------------------------------- ### Provide Debug Logs to AI Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug An example of how to copy console logs with unique prefixes back to the AI to request a fix for a logic error. ```text Here are the debug logs from the console with the unique prefixes I added: [TELEPORT] Player detected: Player1 [TELEPORT] Character found: Player1 at position: 10, 5, 20 [TELEPORT] Destination: 50, 5, 100 [TELEPORT] ERROR: No humanoid found in Player1 The logs show the character is found but then says no humanoid found. This doesn't make sense. Fix this logic error. ``` -------------------------------- ### Quick Reference Template Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices A template for effective prompts combining game context, specific feature, technical requirements, and success criteria, with an example for a zombie survival game. ```text [Game Context] + [Specific Feature] + [Technical Requirements] + [Success Criteria] Example: "For my zombie survival game, create a weapon crafting system using ReplicatedStorage for data sync, supporting 20+ weapon types, that successfully handles concurrent crafting by multiple players." ``` -------------------------------- ### Token Usage Comparison: Without Reference Paths Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths An example of a high-token usage interaction where the AI must search for scripts due to lack of specific path information. ```text User: "Add a health regeneration system to my RPG game" AI: "I need to find your health system first. Let me search for scripts..." [AI searches through project, uses many tokens finding systems] AI: "I found several health-related scripts. Which one should I modify?" User: "The one in ServerScriptService" AI: "I see multiple scripts there. Could you be more specific?" [Multiple rounds of clarification...] ``` -------------------------------- ### Correct service initialization pattern Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization The recommended approach using KnitStart for operations and KnitInit for service references. ```lua ---- Knit Services local PlayerService, DataService function MyService:KnitStart() -- All operations go in KnitStart (runs first) self.DataStore = DataStoreService:GetDataStore("PlayerData") local data = self.DataStore:GetAsync("PlayerData") self.Players = {} end function MyService:KnitInit() -- Only service references in KnitInit (runs second) PlayerService = Knit.GetService("PlayerService") DataService = Knit.GetService("DataService") end ``` -------------------------------- ### Implement proper KnitStart and KnitInit pattern Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization Follow this pattern to ensure service references are initialized in KnitInit and operations are performed in KnitStart to avoid loading delays. ```lua ---- Knit Services local DataService function MyService:KnitStart() -- All operations go here (runs first) self.Data = {} self:LoadPlayerData() self:SetupConnections() end function MyService:KnitInit() -- Only service references (runs second) DataService = Knit.GetService("DataService") end ``` -------------------------------- ### Navigate to Project Directory Source: https://docs.superbulletstudios.com/version-control Use the cd command to enter your project folder. Replace YourProjectName with your actual folder name. ```bash cd Documents/SuperbulletAI/YourProjectName ``` ```bash cd Documents/SuperbulletAI/MyAwesomeGame ``` -------------------------------- ### Correct Pattern for Knit Services Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization Demonstrates the proper implementation of :KnitStart() for logic and :KnitInit() for service references within a Knit service. ```lua local MyService = Knit.CreateService({ Name = "MyService" }) ---- Knit Services local DataService, PlayerService function MyService:KnitStart() -- ✅ All main operations go here (runs first) self.Players = {} self.Config = require(script.Config) self:ConnectEvents() self:LoadDatastore() self:SetupRemotes() end function MyService:KnitInit() -- ✅ Only get service references (runs second) DataService = Knit.GetService("DataService") PlayerService = Knit.GetService("PlayerService") end ``` -------------------------------- ### Correct Pattern for Knit Controllers Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization Demonstrates the proper implementation of :KnitStart() for logic and :KnitInit() for controller references within a Knit controller. ```lua local MyController = Knit.CreateController({ Name = "MyController" }) ---- Knit Controllers local UIController, InputController function MyController:KnitStart() -- ✅ All main operations go here (runs first) self:SetupUI() self:ConnectEvents() self:InitializeData() end function MyController:KnitInit() -- ✅ Only get controller references (runs second) UIController = Knit.GetController("UIController") InputController = Knit.GetController("InputController") end ``` -------------------------------- ### Component Lifecycle Order Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components The sequence of operations during the Knit component lifecycle, starting from Knit.Start() to the final Start() call on component modules. ```text Lifecycle Order: 1. Knit.Start() begins 2. Service/Controller KnitInit() runs 3. ComponentInitializer.Initialize() runs: - Loads all modules in Components/Others/ - Sets up Accessor and Mutator - Calls Init() on all component modules 4. Service/Controller KnitStart() runs 5. ComponentInitializer.Start() runs: - Calls Start() on all component modules ``` -------------------------------- ### Real example - PlayerDamage error Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug A real example of Ofer the console output and a prompt requesting a fix and plain English explanation. ```plaintext ReplicatedStorage.RemoteEvents.PlayerDamage is not a valid member of ReplicatedStorage "ReplicatedStorage" Stack Begin ServerScriptService.CombatSystem:23: function dealDamage ServerScriptService.CombatSystem:8: function onHit Stack End ``` ```plaintext Here's the error from Roblox Studio console: ReplicatedStorage.RemoteEvents.PlayerDamage is not a valid member of ReplicatedStorage "ReplicatedStorage" Stack Begin ServerScriptService.CombatSystem:23: function dealDamage ServerScriptService.CombatSystem:8: function onHit Stack End Fix this and explain in plain English what this error means and why it happened. ``` -------------------------------- ### Action-Based Remote Event Examples Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of using action-based remote events where the client sends an identifier for the action rather than raw numerical values. ```lua -- Good examples: CombatService.AttackTarget:Fire(targetId) QuestService.TurnInQuest:Fire(questId) ShopService.PurchaseItem:Fire(itemId) ``` -------------------------------- ### Common Reset Commands Summary Source: https://docs.superbulletstudios.com/version-control A quick reference for navigating, saving, and resetting your project to various points in history. ```bash # Navigate to your project cd Documents/SuperbulletAI/YourProjectName # Save current work git add . git commit -m "Saving before reset" # Go back 1 version git reset --hard HEAD~1 # Go back 3 versions git reset --hard HEAD~3 # Go to specific version (replace abc1234 with real commit ID) git reset --hard abc1234 ``` -------------------------------- ### Example success criteria for a teleport script Source: https://docs.superbulletstudios.com/prompt-engineering/best-practices Define clear success criteria for your script, including performance, concurrency, and error handling. This example specifies expected behavior for a teleport system. ```text "The script should successfully teleport players between spawn points without causing lag, handle 50+ concurrent players, and include error handling for invalid destinations." ``` -------------------------------- ### Specify Robustness Requirements Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug An example prompt for defining robustness requirements for a teleport system. ```text Create a robust teleport system that handles: - Players leaving during teleport - Invalid teleport destinations - Network lag and disconnections - Multiple simultaneous teleports ``` -------------------------------- ### Configuration and Settings: GameSettings Reference Path Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths Shows how to use a reference path for a game settings configuration to prompt AI for adding new settings and updating systems. ```text Copy to Clipboard result: ["ServerStorage.Configuration.GameSettings"] PROMPT: "For this configuration reference path from Roblox Studio: ['ServerStorage.Configuration.GameSettings'] Add new settings for: MaxPlayersPerTeam (default 5), RoundDuration (default 300 seconds), and EnableFriendlyFire (default false). Update all relevant systems to use these settings." ``` -------------------------------- ### Client-only system prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts for systems that run exclusively on the player's device. ```text "Create a client-only inventory UI system that displays player items" "Build a frontend camera controller for third-person view" "Make a client-side particle effect system for spell casting" ``` -------------------------------- ### Request explanation of timing issues Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug Ask why a script runs before an object is created and how to handle object waiting. ```text Explain why this script runs before the object is created and how to properly wait for objects in Roblox. ``` -------------------------------- ### Problematic Code Snippet Inclusion Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug Example of how to isolate and present the specific code section causing an error. ```lua This section of the generated code is causing the error: local function teleportPlayer(player) local character = player.Character -- This line fails character.HumanoidRootPart.CFrame = spawnPoint.CFrame end The error suggests 'player.Character' is nil. Fix this with proper validation. ``` -------------------------------- ### Example of Going Higher Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug A specific request for logs that capture the trigger and game state before a teleport occurs. ```text The error happens during teleport but I don't understand why it's being called at the wrong time. Add higher-level logs showing what triggers the teleport system and the game state before teleport is attempted. ``` -------------------------------- ### ClientComm Namespace Error Log Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization An example of the error log generated when the ClientComm namespace cannot be found for a Knit service. ```text ReplicatedStorage.Packages._Index.sleitnick_comm@1.0.1.comm.Client.ClientComm:54: Could not find namespace for ClientComm in parent: WaveService ``` -------------------------------- ### Defining and Using an Accessor Component Source: https://docs.superbulletstudios.com/superbullet-knit/auto-components An Accessor.lua or Get().lua file is accessible via self.Accessor or the self.GetComponent alias. ```lua -- Components/Accessor.lua local Accessor = {} function Accessor:GetPlayerData(player) return DataStore:GetData(player) end return Accessor -- In your service: function MyService:KnitStart() local data = self.Accessor:GetPlayerData(somePlayer) -- or use the alias: local data = self.GetComponent:GetPlayerData(somePlayer) end ``` -------------------------------- ### Fallback server initialization using attributes Source: https://docs.superbulletstudios.com/prompt-engineering/knit-initialization Alternative for Script instances when Knit.OnStart():await() doesn't work. Polls the KnitServer_Initialized attribute before requiring Knit and using services. ```lua local KnitModule = ReplicatedStorage:WaitForChild("Packages"):WaitForChild("Knit") repeat task.wait(1) until KnitModule:GetAttribute("KnitServer_Initialized", true) local Knit = require(KnitModule) local MyService = Knit.GetService("MyService") ``` -------------------------------- ### Example of Going Deeper Source: https://docs.superbulletstudios.com/prompt-engineering/fixing-a-bug A specific request for debugging prints inside every conditional and loop to isolate a failure point. ```text The teleport is still failing but I don't know why. Add debugging prints inside every if statement, every loop, and after every variable assignment in the teleport function. I need to see the exact line where it breaks. ``` -------------------------------- ### Incorrect Refactoring Prompts Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Examples of prompts that attempt to refactor multiple components at once, which is discouraged due to lower success rates. ```text "Break down this entire 500-line service into components" "Refactor this whole system to use proper component architecture" "Split this controller into multiple components" ``` -------------------------------- ### Complete UI System Template Source: https://docs.superbulletstudios.com/prompt-engineering/making-user-interface A comprehensive template for planning entire UI systems, including structure, responsive design, functionality, performance, and testing. ```text UI SYSTEM: [Name of interface] STRUCTURE: - ScreenGui: [Root container name] - [Main layout containers] - [Individual UI elements] RESPONSIVE DESIGN: - Desktop: [Layout for larger screens] - Mobile: [Adaptations for mobile devices] FUNCTIONALITY: - [Key features and interactions] - [Data integration requirements] - [Animation and feedback] PERFORMANCE: - [Optimization strategies] - [Memory management] TESTING: - [Validation requirements] - [Edge cases to handle] ``` -------------------------------- ### Integration Testing Checklist Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features A checklist for verifying the new weather system integration without breaking existing game mechanics. ```text Add the new weather system, then create a test script that verifies: 1. Weather changes don't break existing day/night cycle 2. Rain effects work with current lighting system 3. Weather data saves/loads with existing world data 4. Performance stays above 30 FPS with weather active ``` -------------------------------- ### Create ShopService with utility components Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure Use this structure for multiple related but distinct functionalities. ```text "Create a ShopService with Others/PriceCalculator for dynamic pricing and Others/DiscountManager for handling sales" ``` -------------------------------- ### Accessing Dynamic Remotes on the Client Source: https://docs.superbulletstudios.com/superbullet-knit/dynamic-remotes Demonstrates how to retrieve a service and interact with dynamically registered signals and methods on the client side. ```lua -- Client-side local InventoryService = Knit.GetService("InventoryService") -- Use the dynamically registered signal InventoryService.OnItemCollected:Connect(function(itemId) print("I collected:", itemId) end) -- Use the dynamically registered method local inventory = InventoryService:GetInventory() ``` -------------------------------- ### Responsive Inventory Grid Prompt Source: https://docs.superbulletstudios.com/prompt-engineering/making-user-interface A prompt structure for creating a responsive inventory grid using UIGridLayout and AspectRatio constraints. ```text "Create a responsive inventory grid that: - Uses UIGridLayout with AspectRatio constraint - Scales from 4x4 on desktop to 3x3 on mobile - Maintains square item slots regardless of screen size - Uses Scale values for consistent proportions" ``` -------------------------------- ### Server-Side Validation Pattern Source: https://docs.superbulletstudios.com/prompt-engineering/organizing-project-structure An example of server-side validation for a purchase action, ensuring the item exists and the player has sufficient currency before proceeding. ```lua -- Server-side validation example function ShopService:PurchaseItem(player, itemId) local item = GameData.Items[itemId] if not item then return false end if player.Currency.Value < item.Price then return false -- Not enough currency end -- Proceed with purchase... end ``` -------------------------------- ### Tool and Equipment Systems: SwordScript Reference Path Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths Shows how to use a reference path for a sword tool script to prompt AI for adding a combo attack system. ```text Copy to Clipboard result: ["StarterPack.Sword.SwordScript"] PROMPT: "Using this tool script reference path from Roblox Studio: ['StarterPack.Sword.SwordScript'] Add a combo system where players can chain attacks. First attack does normal damage, second does 1.5x, third does 2x damage. Reset combo after 3 seconds of no attacks." ``` -------------------------------- ### Reset to Previous Version Source: https://docs.superbulletstudios.com/version-control Use this command to revert the project to the version immediately preceding the current one. ```bash git reset --hard HEAD~1 ``` -------------------------------- ### Hierarchical System Building Reference Source: https://docs.superbulletstudios.com/prompt-engineering/using-reference-paths Use this format to define a new system structure under a root reference path. ```text "Root reference path from Roblox Studio: ['ReplicatedStorage.GameSystems'] Create a new 'QuestSystem' folder under this path with the following structure: - QuestData (folder for quest definitions) - QuestManager (script for quest logic) - QuestGUI (folder for UI elements) " ``` -------------------------------- ### Weapon Durability System Feature Request Source: https://docs.superbulletstudios.com/prompt-engineering/adding-features A concrete example of a feature request for adding a weapon durability system to an existing combat architecture. ```text FEATURE ADDITION REQUEST: Existing System: Combat system with basic sword fighting, health management, and respawn functionality Current Architecture: - Health stored in player.Character.Humanoid.Health - Damage dealt via RemoteEvent "DealDamage" - Weapons are Tool objects in StarterPack - Respawn at fixed spawn points New Feature: Weapon durability system where weapons degrade with use Integration Requirements: - Add Durability attribute to existing weapon Tools - Use current DealDamage RemoteEvent to track usage - Show durability in existing weapon UI - Weapons break and disappear when durability reaches 0 Constraints: - Must work with all existing weapons - No performance impact during combat - Compatible with current weapon trading system Success Criteria: Weapons lose durability with each hit, display current durability, and properly remove when broken ```