I’ve been trying to edit the new Homestore Template but i’m having issues with a script
There is no errors or warnings in the output, i rewrote the script like 3 times and i’m slowly giving up at this point
local TS = game:GetService("TweenService")
local function flash(par)
local highlight = Instance.new("Highlight")
highlight.Parent = par
highlight.OutlineColor = Color3.fromRGB(170, 0, 255)
highlight.FillColor = Color3.fromRGB(255, 255, 255)
highlight.FillTransparency = 1
highlight.OutlineTransparency = 1
TS:Create(highlight,TweenInfo.new(1.5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,2,true,0.25),{FillTransparency = 0.4,OutlineTransparency = 0}):Play()
game.Debris:AddItem(highlight,4)
end
for i,Outfit in ipairs(game.Workspace.Mannequins:GetDescendants()) do
if Outfit:IsA("Model") and Outfit:HasTag("Mannequin") then
local cost = Outfit:GetAttribute("cost")
local creator = Outfit:GetAttribute("creator")
local outfitname = Outfit:GetAttribute("outfitname")
local limited = Outfit:GetAttribute("limited")
local LimitedText = "no"
local costText = "5R$"
if limited == true then
LimitedText = "no"
end
if cost == 0 then
costText = "free"
else
costText = tostring(cost.."R$")
end
local TemplateClone = script.Parent.ProductsFrame.ProductTemplate:Clone()
TemplateClone.Parent = script.Parent.ProductsFrame
TemplateClone.Name = outfitname
TemplateClone.ProductInfo.Text = "Creator:"..creator.." | ".."Cost: "..costText.." | ".."Limited Items: "..LimitedText
TemplateClone.ProductName.Text = outfitname
TemplateClone.Visible = true
TemplateClone:AddTag("AllCategory")
TemplateClone:AddTag(Outfit:GetAttribute("category"))
TemplateClone.TextButton.MouseButton1Click:Connect(function()
flash(Outfit)
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Base = Outfit:FindFirstChild("Base")
if Base and character then
character.PrimaryPart.CFrame = (Base.CFrame * CFrame.new(0,0,-5))
end
TS:Create(script.Parent.Parent.Parent.Background,TweenInfo.new(.5),{Position = UDim2.fromScale(-1,0)}):Play()
TS:Create(script.Parent.Parent.Parent.Blur,TweenInfo.new(.5),{Position = UDim2.fromScale(-1,0)}):Play()
TS:Create(script.Parent.Parent.Parent.MainMenu,TweenInfo.new(.5),{Position = UDim2.fromScale(-1,0)}):Play()
TS:Create(script.Parent.Parent.Parent.Home,TweenInfo.new(.5),{Position = UDim2.fromScale(-1,0)}):Play()
TS:Create(script.Parent.Parent.Parent.revealButton,TweenInfo.new(.7),{ImageTransparency = 0}):Play()
task.delay(0.7,function()
script.Parent.Parent.Parent.revealButton.Interactable = true
end)
end)
TemplateClone.Visible = true
end
end
Try this script and then check the output window, it should hopefully provide more information about the issue.
local TS = game:GetService("TweenService")
local function flash(par)
local highlight = Instance.new("Highlight")
highlight.Parent = par
highlight.OutlineColor = Color3.fromRGB(170, 0, 255)
highlight.FillColor = Color3.fromRGB(255, 255, 255)
highlight.FillTransparency = 0.5 -- Adjusted for visibility
highlight.OutlineTransparency = 0
TS:Create(highlight, TweenInfo.new(1.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 2, true, 0.25), {FillTransparency = 0.4, OutlineTransparency = 0}):Play()
game.Debris:AddItem(highlight, 4)
end
for i, Outfit in ipairs(game.Workspace.Mannequins:GetDescendants()) do
if Outfit:IsA("Model") and Outfit:HasTag("Mannequin") then
local cost = Outfit:GetAttribute("cost") or 0
local creator = Outfit:GetAttribute("creator") or "Unknown"
local outfitname = Outfit:GetAttribute("outfitname") or "Unnamed"
local limited = Outfit:GetAttribute("limited") or false
local LimitedText = limited and "yes" or "no"
local costText = cost == 0 and "free" or tostring(cost .. "R$")
print("Cloning template for outfit: " .. outfitname) -- Debugging output
local TemplateClone = script.Parent.ProductsFrame.ProductTemplate:Clone()
TemplateClone.Parent = script.Parent.ProductsFrame
TemplateClone.Name = outfitname
TemplateClone.ProductInfo.Text = "Creator: " .. creator .. " | Cost: " .. costText .. " | Limited Items: " .. LimitedText
TemplateClone.ProductName.Text = outfitname
TemplateClone.Visible = true
TemplateClone:AddTag("AllCategory")
TemplateClone:AddTag(Outfit:GetAttribute("category"))
local button = TemplateClone.TextButton
if button then
button.MouseButton1Click:Connect(function()
flash(Outfit)
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Base = Outfit:FindFirstChild("Base")
if Base and character then
character.PrimaryPart.CFrame = (Base.CFrame * CFrame.new(0, 0, -5))
else
print("Base part not found or character is missing.")
end
TS:Create(script.Parent.Parent.Parent.Background, TweenInfo.new(0.5), {Position = UDim2.fromScale(-1, 0)}):Play()
TS:Create(script.Parent.Parent.Parent.Blur, TweenInfo.new(0.5), {Position = UDim2.fromScale(-1, 0)}):Play()
TS:Create(script.Parent.Parent.Parent.MainMenu, TweenInfo.new(0.5), {Position = UDim2.fromScale(-1, 0)}):Play()
TS:Create(script.Parent.Parent.Parent.Home, TweenInfo.new(0.5), {Position = UDim2.fromScale(-1, 0)}):Play()
TS:Create(script.Parent.Parent.Parent.revealButton, TweenInfo.new(0.7), {ImageTransparency = 0}):Play()
task.delay(0.7, function()
script.Parent.Parent.Parent.revealButton.Interactable = true
end)
end)
else
print("TextButton not found in template!")
end
TemplateClone.Visible = true
end
end
By adding debug statements and checks, the script can provide more feedback on its state during execution, which may help identify the root cause of the issue. If problems persist, consider testing smaller parts of the script in isolation to isolate the problem further.