I looked into TagEditor and CollectionService, and managed to get TagEditor to run, since it’s not exactly rocket science.
The script is supposed to make the trees move just slightly, make them look as if wind is impacting their physics or such, here it is:
Yes, the script is inside of ServerScriptService
local CollectionService = game:GetService("CollectionService")
for _part in CollectionService:GetTagged("TreeTop")do
pos = script.Parent.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
x = 0
z = 0
T = -99999
tall = script.Parent.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
while true do
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
script.Parent.CFrame =
CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
wait()
T = T + 0.12
end
end
Only issue really is that the trees don’t move, and output shows "Position is not a valid member of ServerScriptService.
I am total garbage at scripting, hence the request for help.
As the error says, Position is not a property of ServerServiceStorage, Position must be for the object with the tag, right?
local CollectionService = game:GetService("CollectionService")
for _, part in pairs(CollectionService:GetTagged("TreeTop")) do
local pos = part.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
local x, z, T = 0, 0, -99999
local tall = part.Size.Y / 2
math.randomseed(tick())
local rand = (math.random(0,20))/10
task.spawn(function()
while true do
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
part.CFrame = CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
task.wait()
T += 0.12
end
end)
end
It doesn’t display which line it occurs at, but it puts out this:
19:56:25.651 Position is not a valid member of ServerScriptService “ServerScriptService” - Server - Script:4
local CollectionService = game:GetService("CollectionService")
for _,part in CollectionService:GetTagged("TreeTop") do
pos = part.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
x = 0
z = 0
T = -99999
tall = script.Parent.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
task.spawn(function()
while true do
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
script.Parent.CFrame =
CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
task.wait()
T = T + 0.12
end
end)
end
local CollectionService = game:GetService("CollectionService")
for _,part in CollectionService:GetTagged("TreeTop") do
pos = part.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
x = 0
z = 0
T = -99999
tall = part.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
task.spawn(function()
while true do
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
part.CFrame =
CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
task.wait()
T = T + 0.12
end
end)
end