script.Parent.MouseButton1Click:connect(function(p)
local player = game.Players.LocalPlayer
print("Got the player")
for i=1, 50 do
print("Started the cycle")
local v = player:FindFirstChild("HouseItem"..tostring(i).."Position");
if v then -- Let's not break your script if there's not 50 slots.
print("Got the House Item Position")
if v.Value ~= CFrame.new(0,0,0) then
print("Position ~= None")
local f = player:FindFirstChild("HouseItem"..tostring(i).."Name");
if f then
print("Got House Item Name")
local furn = game.ReplicatedStorage:FindFirstChild(f.Value)
if furn then
print("Got the furniture")
local pp = furn:FindFirstChild("PrimaryPart")
if pp then
print("Got the primary part")
pp.CFrame = CFrame.new(v.Value)
print("Set the primary part")
end
end
end
end;
end;
end;
end)
Inside the player are values for HouseItemPosition and HouseItemName
if the HouseItemPosition ~= CFrame.New(0,0,0) (Which basically means that the player doesn't have it in their house) then it will look for the name corresponding with that item's position. It will then spawn a furniture of that name into the position. But... It doesn't work right.
It only ever gets up to the part where it prints print("Got the House Item Position") and then stops working. Help please?
