doesnt work
- User
doesnt work
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
doesnt work
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Okay, let's troubleshoot this. "Doesn't work" is a bit vague, so let's break down the common issues and how to check them. I'll give you a checklist and then some debugging steps.
1. Checklist - Double-Check These First
ProximityPrompt directly inside the NPC's primary part (the Model or Part you're using as the NPC)? Not a child of a child, but a direct child.ShopGui exactly in ReplicatedStorage? No folders in between unless your script is adjusted to account for them.LocalScript in either StarterPlayerScripts or directly inside the NPC?LocalScript enabled (the little play button next to it in the Explorer)?2. Debugging Steps - Let's Pinpoint the Problem
I'll give you code snippets to add to your LocalScript to help you see what's happening. Add these temporarily to help diagnose, then remove them once you've fixed the issue.
Check if the ProximityPrompt is Found:
local proximityPrompt = script.Parent:FindFirstChild("ProximityPrompt") -- If script is inside the NPC
if not proximityPrompt then
-- If the script is in StarterPlayerScripts:
proximityPrompt = workspace:FindFirstChild("NPC"):FindFirstChild("ProximityPrompt")
end
if not proximityPrompt then
print("ProximityPrompt NOT FOUND!") -- Check the Output window
return
else
print("ProximityPrompt FOUND!") -- Check the Output window
end
Run the game and check the Output window. If you see "ProximityPrompt NOT FOUND!", the script isn't finding the ProximityPrompt. Double-check its placement and name.
Check if the ShopGui is Found:
local shopGui = game.ReplicatedStorage:FindFirstChild("ShopGui")
if not shopGui then
print("ShopGui NOT FOUND!") -- Check the Output window
return
else
print("ShopGui FOUND!") -- Check the Output window
end
Run the game and check the Output window. If you see "ShopGui NOT FOUND!", the script isn't finding the ShopGui. Double-check its location and name.
Check if the MainFrame is Found:
local shopGui = game.ReplicatedStorage:FindFirstChild("ShopGui")
if not shopGui then return end
local guiClone = shopGui:Clone()
guiClone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = guiClone:FindFirstChild("MainFrame")
if not mainFrame then
print("MainFrame NOT FOUND!") -- Check the Output window
return
else
print("MainFrame FOUND!") -- Check the Output window
end
Run the game and check the Output window. If you see "MainFrame NOT FOUND!", the script isn't finding the MainFrame. Double-check its placement within the ShopGui.
3. Common Mistakes
ReplicatedStorage is accessible from both the server and the client. However, modifying the PlayerGui (where the shop appears) must be done from a LocalScript on the client.WaitForChild is important because it waits for an object to load before trying to access it. This can prevent errors if the ShopGui or PlayerGui isn't immediately available.ShopGui to the PlayerGui correctly.4. Provide More Information
If you're still stuck, please provide the following:
ProximityPrompt, ShopGui, and LocalScript.I'm here to help you get this working! Let's work through it step by step.