I made a placement system for my game and it won't work. No errors come up. Help please? (P.S, this is all inside one handler script.)
local items = script.Parent.BuyItems.ShopButton.Frame:GetChildren()
local viewitems = game.ReplicatedStorage.Items:GetChildren()
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
for i,v in pairs(items) do
if v:IsA("TextButton") then
local name = v.Name
v.MouseButton1Click:Connect(function()
local cash = plr:WaitForChild("leaderstats").Cash
if cash then
cash.Value = cash.Value - v.Cost.Value
for x,z in pairs(viewitems) do
if z:IsA("Model") then
while wait() do
if mouse.Target == workspace:FindFirstChild(plr.CurrentBase.Value) then
if z.Name == name then
z:SetPrimaryPartCFrame(mouse.Hit)
end
end
end
end
end
end
end)
end
end

2 comments
What is plr.CurrentBase.Value? Do your models have a PrimaryPart set?
CurrentBase is the part that the player can place objects on. And yes. I have a primary part set. It's the hitbox for it.