#Collision handle issue
22 messages · Page 1 of 1 (latest)
can I see the LocalScript that remotes.place:InvokeServer()
this script just check if out of bound, if collide with player, and place
OK
@sonic loom are u there?
yes
local module = require(game.ReplicatedStorage.modules.PlacementHandler)
local placement = module.new(
4, -- Grid size
game.ReplicatedStorage.items, -- Item location
Enum.KeyCode.R, -- Rotate key
Enum.KeyCode.X -- Terminate key
)
wait(2)
placement:activate("Toggle", workspace.Baseplate.itemholder, workspace.Baseplate, true)
local mouse = game.Players.LocalPlayer:GetMouse()
local canPlace = true
local placeCooldown = 1 -- 1 second cooldown between placements
mouse.Button1Down:Connect(function()
if canPlace then
canPlace = false -- Temporarily disable placement
placement:place(game.Players.LocalPlayer, "Toggle", workspace.Baseplate.itemholder, placement:getInstantCFrame(), workspace.Baseplate)
wait(placeCooldown) -- Wait for the cooldown
canPlace = true -- Re-enable placement
end
end)
@sonic loom u found the issue?
no
ok
can I see the ModuleScript
all
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
found the issue?
@sonic loom
I think it's because it defines CFrame after checked if not collide
move it to above if not collide