You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make when the button clicked, a model(house) will clone if the model’s(house)
name is equal to the button name -
What is the issue? Include screenshots / videos if possible!
model(house)cloned more than 1 also one of them is not equal to the button name that
been clicked
this is the screenshot:
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I can't find any solutions so far
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I Used remote event server-side
this is code from server script
local houses = game.ReplicatedStorage.House:GetChildren()
local pos = game.Workspace.PromptInterract.HouseOwning:GetChildren()
local event = game.ReplicatedStorage.Remotes.CloneHouseOne1
event.OnServerEvent:Connect(function(player)
print("getting player from frame")
local frame = player.PlayerGui:WaitForChild("HouseGui"):WaitForChild("HouseFrame").ScrollingFrame:GetChildren()
print("getting frame children")
for i , v in pairs(frame)do
for k , p in pairs(pos)do
print("looping childrens")
for _ , house in pairs(houses)do
if v.Name == house.Name and v:WaitForChild("Name").Value == house.Name then
print(house.Name , p:WaitForChild("PlayerPlcae").Value == player.Name , v.Name == house.Name)
print("same")
if p:WaitForChild("PlayerPlcae").Value == player.Name then
print("same")
local clone = house:Clone()
print("cloning house")
clone.Parent = workspace:WaitForChild(player.Name.."Stuff")
print("set parent model")
clone:SetPrimaryPartCFrame(p:WaitForChild("HouseSpawnPart").CFrame , CFrame.Angles(math.rad(90),0,0))
print("select position model")
end
end
end
end
end
end)
This is code from client-side
script.Parent.Activated:Connect(function()
game.ReplicatedStorage.Remotes.CloneHouseOne1:FireServer()
print("fired form server")
end)
it will be great help if anyone could help solve this problem
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.