No idea why this error is outputting as I have tried several different methods and read up about 5-6 different community posts with answers that work so no clue on my part.
However I would greatly appreciate any sort of help, This script locates toolcamera which is a camera and the shops name, but on the part where it’s supposed to have the name of the shop it outputs in an error, So if anyone would know why I would greatly appreciate the help.
Shop + Descendants :
Main script in shop :
local proximityprompt = script.Parent
local event = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("NewShop")
proximityprompt.Triggered:Connect(function(plr)
local shop = script.Parent.Parent.Parent.HotDogStandSans.Name
local toolCamera = script.Parent.Parent.Parent:FindFirstChild("Camera")
event:FireClient(plr,toolCamera,shop)
end)
Local script which handles the shop :
if not game.Players.LocalPlayer.Character then game.Players.LocalPlayer.CharacterAdded:Wait() end
local firstevent = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("NewShop")
local currentCam = workspace.CurrentCamera
local tweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ShopFolder = ReplicatedStorage:WaitForChild("Shops")
function Invisible(TurnsInvisible)
if TurnsInvisible == true then
for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("Decal") then
if v ~= game.Players.LocalPlayer.Character.PrimaryPart then
v.Transparency = 1
end
elseif v:IsA("Accessory") then
v:FindFirstChildOfClass("MeshPart").Transparency = 1
end
end
else
for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("Decal") then
if v ~= game.Players.LocalPlayer.Character.PrimaryPart then
v.Transparency = 0
end
elseif v:IsA("Accessory") then
v:FindFirstChildOfClass("MeshPart").Transparency = 0
end
end
end
end
firstevent.OnClientEvent:Connect(function(shop,toolCamera,plr)
local ShopGui = ShopFolder[shop].Shop
local proximityprompt = toolCamera.Parent.ProximityPromptHolder:FindFirstChild("ProximityPrompt")
proximityprompt.Enabled = false
currentCam.CameraType = Enum.CameraType.Scriptable
task.spawn(Invisible,true)
local camSwitch = tweenService:Create(currentCam, TweenInfo.new(1.75), {CFrame = toolCamera.CFrame})
camSwitch:Play()
if not game.Players.LocalPlayer.PlayerGui:FindFirstChild("Shop") then
local gui = ShopGui:Clone()
gui.Parent = script.Parent.Parent
end
end)
Error outputs on line 34 :
local ShopGui = ShopFolder[shop].Shop
ReplicatedStorage where the shop folder is stored :
And again help would be greatly appreciated thank you!