Answered by
7 years ago Edited 7 years ago
Your code is going like this, it seems that your generate function cant check the variables targ, and node.
So now it will say:
local plant = flora:FindFirstChild("medBushA") (instead of)
local plant = flora:FindFirstChild(targ)
targ isn't a thing but you still trying to find it in your flora folder, and for the p2.PrimaryPart.CFrame = node.CFrame, it's littery the same thing cause node is a variable and a variable doesn't have a CFrame, but yeah here is the correct code you can test it and leave me a like if it worked ;)
02 | ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | floraEvent = ReplicatedStorage:WaitForChild( "floraEvent" ) |
04 | flora = ReplicatedStorage:WaitForChild( "Flora" ) |
07 | function generateFlora(targ,node) |
08 | local plant = flora:FindFirstChild( "medBushA" ) |
09 | local p 2 = plant:Clone() |
10 | p 2. Parent = game.Workspace |
16 | floraEvent.OnClientEvent:Connect( function (...) |
18 | for _, arg in pairs (args) do |
19 | print (args [ 1 ] .Name.. "Located" ) |
22 | wait(. 1 ) print (args [ 4 ] ) print (args [ 5 ] ) |
24 | generateFlora(v, args [ 5 ] ) |