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!
Basically I want my coins to spawn somewhere else than inside buildings, since they randomly spawn in certain areas of multiple Parts i’ve added!
- What is the issue? Include screenshots / videos if possible!
https://gyazo.com/c77d503dc10bd7a05a28441a508964f2
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
local function CheckAreaofCoins()
for i,K in pairs(workspace.Houses:GetChildren()) do
local CFrameHouseArea = K:GetExtentsSize().X * K:GetExtentsSize().Z
return CFrameHouseArea/2; -- I included /2 cause I was testing how I can do this..
end
end
for i,v in pairs(workspace.Coinspawners:GetChildren()) do
local sa = v.Size.X * v.Size.Z;
for i = 1, 20 do
local coin = game:GetService("ServerStorage"):FindFirstChild("Coin"):Clone()
coin.Parent = workspace.Folder
coin.CFrame = v.CFrame * CFrame.new(math.random(-v.Size.X / 2, v.Size.X / 2)-math.random(5,10), 1.5, math.random(-v.Size.Z / 2, v.Size.Z / 2)-math.random(5,10))
if coin.CFrame == CheckAreaofCoins() then
print("true;")
end
end;
end;
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!
So The Printing doesn’t work, And I’m unsure if it’s the Way the function is, or if it’s only getting the Size X and Size Y of the models, I want it to return CFrame of the Size and the Y… How would I be able to get this returned into a CFrame, and then be able to use it so it detects my Coin is inside any of that Area of the house?