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.
If the script isn't working, let's troubleshoot step by step. Here are the most common issues and fixes:
ProximityPrompt is properly set upProximityPrompt might not be correctly attached to the NPC.Part or Model).PromptText to "Press E to Open Shop".Distance to 10 (or your preferred range).ActionText to "E".HoldDuration to 0.5 (optional).LocalScript is in the correct locationLocalScript might not be in the right place.LocalScript inside the NPC (if the NPC is a Model).LocalScript in StarterPlayerScripts (but you'll need to find the ProximityPrompt in the workspace).LocalScript is inside the NPC:local proximityPrompt = script.Parent:FindFirstChild("ProximityPrompt") -- Looks for ProximityPrompt in the NPC
if not proximityPrompt then
warn("ProximityPrompt not found in NPC!")
return
end
proximityPrompt.Triggered:Connect(function(player)
if player == game.Players.LocalPlayer then
openShopGui()
end
end)
local function openShopGui()
local shopGui = game.ReplicatedStorage:FindFirstChild("ShopGui")
if not shopGui then
warn("ShopGui not found in ReplicatedStorage!")
return
end
local guiClone = shopGui:Clone()
guiClone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = guiClone:FindFirstChild("MainFrame")
if mainFrame then
mainFrame.Visible = true
else
warn("MainFrame not found in ShopGui!")
end
end
LocalScript is in StarterPlayerScripts:local proximityPrompt = workspace:FindFirstChild("NPC"):FindFirstChild("ProximityPrompt") -- Adjust "NPC" to your NPC's name
if not proximityPrompt then
warn("ProximityPrompt not found in workspace!")
return
end
proximityPrompt.Triggered:Connect(function(player)
if player == game.Players.LocalPlayer then
openShopGui()
end
end)
local function openShopGui()
local shopGui = game.ReplicatedStorage:FindFirstChild("ShopGui")
if not shopGui then
warn("ShopGui not found in ReplicatedStorage!")
return
end
local guiClone = shopGui:Clone()
guiClone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = guiClone:FindFirstChild("MainFrame")
if mainFrame then
mainFrame.Visible = true
else
warn("MainFrame not found in ShopGui!")
end
end
ShopGui is in ReplicatedStorageShopGui might not be in ReplicatedStorage.ReplicatedStorage.ShopGui is inside it.MainFrame exists inside ShopGuiMainFrame might not be a direct child of ShopGui.ShopGui in the Explorer.MainFrame is inside it.local mainFrame = guiClone:FindFirstChild("MainFrame") or guiClone:FindFirstChild("SomeFolder"):FindFirstChild("MainFrame")
E.ClickDetector (if ProximityPrompt still doesn't work)If ProximityPrompt isn't working, you can use a ClickDetector instead:
ClickDetector to your NPC.LocalScript to detect clicks:
local clickDetector = script.Parent:FindFirstChild("ClickDetector")
if not clickDetector then
warn("ClickDetector not found!")
return
end
clickDetector.MouseClick:Connect(function(player)
if player == game.Players.LocalPlayer then
openShopGui()
end
end)
local function openShopGui()
local shopGui = game.ReplicatedStorage:FindFirstChild("ShopGui")
if not shopGui then
warn("ShopGui not found in ReplicatedStorage!")
return
end
local guiClone = shopGui:Clone()
guiClone.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local mainFrame = guiClone:FindFirstChild("MainFrame")
if mainFrame then
mainFrame.Visible = true
else
warn("MainFrame not found in ShopGui!")
end
end
✅ ProximityPrompt is attached to the NPC.
✅ LocalScript is in the correct location (inside NPC or StarterPlayerScripts).
✅ ShopGui is in ReplicatedStorage.
✅ MainFrame is inside ShopGui.
✅ Play Mode is running, and you're pressing E near the NPC.
If it still doesn't work, let me know what errors appear in the Output window! 🚀