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 the folder to be placed in canvas (part in workspace)
- What is the issue? Include screenshots / videos if possible!
The script is stalling when i call the modulescript function
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
All of the issues were talking about how there was a loop forever, i had one, but i commented it out, it still doesnt work
Module script function:
function Placement.new(canvasPart)
local self = setmetatable({}, Placement)
-- the part we are placing models on
self.CanvasPart = canvasPart
-- custom logic depending on if the sevrer or not
if (isServer) then
-- create a folder we'll place the objects in
self.CanvasObjects = Instance.new("Folder")
self.CanvasObjects.Name = "CanvasObjects"
self.CanvasObjects.Parent = canvasPart
else
-- initiate the twin on the server
self.CanvasObjects = initPlacement:InvokeServer(canvasPart)
end
-- we'll talk about these properties later in the post
self.Surface = Enum.NormalId.Top
self.GridUnit = 1
print(canvasPart.Name)
return self
end
Local script:
print("Hello World!")
local canvas = game.Workspace.Canvas
local furniture = game.ReplicatedStorage.Furniture
local placementClass = require(game:GetService("ReplicatedStorage"):WaitForChild("Placement"))
local placementObjects = {}
print("2")
print(placementClass.new)
local placement = placementClass.new(canvas)
wait()
print("Placement Canvas")
local mouse = game.Players.LocalPlayer:GetMouse()
--mouse.TargetFilter = placement.CanvasObjects
print("3")
local tableModel = furniture.Table:Clone()
tableModel.Parent = mouse.TargetFilter
print(tableModel.Parent)
print("4")
--local rotation = 0
--local function onRotate(actionName, userInputState, input)
-- if (userInputState == Enum.UserInputState.Begin) then
-- rotation = rotation + math.pi/2
-- end
--end
--game:GetService("ContextActionService"):BindAction("rotate", onRotate, false, Enum.KeyCode.R)
--game:GetService("RunService").RenderStepped:Connect(function(dt)
-- local cf = placementClass:CalcPlacementCFrame(tableModel, mouse.Hit.p, rotation)
-- tableModel:SetPrimaryPartCFrame(cf)
--- print(tableModel.Name)
--end)
print("Yeet")
it runs up to when it prints the function
Anyone have any ideas whats going on?
Thanks,
Coconut.
PS: This is from egomooses furniture placement system, im trying to complete it.