Hi developers,
I need help with my script (just one part of it), because I’m still pretty new to this ![]()
When I make a copy from RS and use PivotTo to place it on a player’s fence, if it’s larger than 4 studs (in my case), it sinks right into the ground, and I don’t know what to do about it
Photo:
My part of the script:
local plot = findPlayerPlot(player)
if plot and not plot:FindFirstChild('fence') then
local prop = plot:FindFirstChild('properties')
if prop then
local skinVariable = prop:FindFirstChild('skin')
if skinVariable then
local skinValue = skinVariable.Value
--{custom rotate variable}--
local rotation = 90
--{if player plot has one of these names, then rotate it -90 degrees}--
if plot.Name == 'plot_1' or plot.Name == 'plot_2' or plot.Name == 'plot_3' then
rotation = -rotation
end
--// Change skin
--{if new value is different than old one, then destroy old fence and copy new one}--
skinVariable:GetPropertyChangedSignal('Value'):Connect(function()
local newValue = skinVariable.Value
if allSkins[newValue] then
--{if fence is already in plot, then destroy it}--
if plot:FindFirstChild('fence') then
plot.fence:Destroy()
task.wait(.1)
local copy = allSkins[newValue]:Clone()
copy.Parent = plot
copy.Name = 'fence'
copy:PivotTo(plot.fencePoint.CFrame * CFrame.Angles(0, math.rad(90), math.rad(rotation)))
end
end
end)
--{copy fence in replicated storage and then paste it into the plot}--
if allSkins[skinValue] then
local copy = allSkins[skinValue]:Clone()
copy.Parent = plot
copy.Name = 'fence'
--{set the right position of the fence}--
copy:PivotTo(plot.fencePoint.CFrame * CFrame.Angles(0, math.rad(90), math.rad(rotation)))
end
end
end
end
end
Thanks! ![]()


