I'm making a c4 and I want it to stick to walls if the player is in a zone nearby the wall
so
i made a script for it but now it always goes to the middel of the map here is my script
script.Parent.Thouchpart.Touched:connect(function(hit)
if hit.Name == "sticktowall" then
local model = Instance.new("Model")
model.Parent = game.Workspace
script.Parent.Parent = model
model.PrimaryPart = script.Parent.Thouchpart
local value = hit.Parent.Center.Position
script.Value.Value = value
print(script.Value.Value)
local cfr = model:GetPrimaryPartCFrame()
wait()
model:SetPrimaryPartCFrame(CFrame.new(Vector3.new(script.Value.Value)))
cfr = model:GetPrimaryPartCFrame()
print(cfr)
print(model:GetPrimaryPartCFrame())
script.Parent.Parent = game.Workspace
model:Destroy()
