#Spawner of dropper
1 messages · Page 1 of 1 (latest)
Two options:
- Add an attachment to the part where you want the part to spawn. Use the attachment's
WorldCFrameto tell the part where to spawn - Add an invisible, no-collide anchored version of the dropped part. Clone that every drop, resetting transparency, no-collide, and anchored.
The second tip there is invisible block under the dropper
** You are now Level 1! **
There already is a block? Oh. My bad.
Does that part have CanCollide off?
Wait I little busy I was talking from phone I will reply to this message when I take my PC
Yes the can collide was off
Next what do i do?
You move the attachment to where you want the thing to drop from
The attach will be the spawner? Like the block is came out from attach?
I add anyhting to this in attachment?
It's a way of marking position, so we can use WorldCFrame to get the position of where the block should be when spawned
No
Okay, so in your spawn script, use that attachment's WorldCFrame when you spawn a new part
local tycoon = script.parent.parent.parent
local dropperPartsFolder = tycoon:FindFirstChild("DropperParts")
local dropColorValue = tycoon:FindFirstChild("Values").DropColorValue
local materialValue = tycoon:FindFirstChild ("Values").MaterialValue
local billboardGui = game.ReplicatedStorage:FindFirstChild("BillboardGui")
while wait(3) do
local cloneGui = billboardGui:Clone()
local part = Instance.new ("Part", dropperPartsFolder)
part.Size = Vector3.new (1,1,1)
part.BrickColor = dropColorValue.Value
part.Material = materialValue.Value
part.Name = "DropperPart"
part.CFrame = script.parent.Spawner.CFrame
local cashValue = Instance.new("IntValue", part)
cashValue.Value = 5
cashValue.Name = "CashValue"
cloneGui.Parent = part
cloneGui.Frame.TextLabel.Text = "$"..cashValue.Value.." Cash"
game.Debris:AddItem(part, 15)
end
This is the script
Which i change?
You should know this. Where do you set the position of the part you spawn in.
How?
Wait i see it
its -0.458, 0, 0.5
That doesn't matter
Ok
In the script, change the position you're currently using to the .WorldCFrame of the attachment, don't copy and paste the property value
This is the script where i add the position?
** You are now Level 2! **
You wrote this script didn't you? Yes, where you set the part.CFrame is where you should use the attachment's .WorldCFrame
local tycoon = script.Parent.Parent.Parent
local dropperPartsFolder = tycoon:FindFirstChild("DropperParts")
local dropColorValue = tycoon:FindFirstChild("Values").DropColorValue
local materialValue = tycoon:FindFirstChild("Values").MaterialValue
local billboardGui = game.ReplicatedStorage:FindFirstChild("BillboardGui")
-- Reference to the attachment to position the part
local attachment = script.Parent:FindFirstChild("Attachment") -- adjust path if needed
while wait(3) do
local cloneGui = billboardGui:Clone()
local part = Instance.new("Part", dropperPartsFolder)
part.Size = Vector3.new(1, 1, 1)
part.BrickColor = dropColorValue.Value
part.Material = materialValue.Value
part.Name = "DropperPart"
-- Set CFrame using the attachment’s WorldCFrame
if attachment then
part.CFrame = attachment.WorldCFrame
else
warn("Attachment not found, defaulting to Spawner CFrame")
part.CFrame = script.Parent.Spawner.CFrame
end
local cashValue = Instance.new("IntValue", part)
cashValue.Value = 5
cashValue.Name = "CashValue"
cloneGui.Parent = part
cloneGui.Frame.TextLabel.Text = "$" .. cashValue.Value .. " Cash"
game.Debris:AddItem(part, 15)
end
This is my script now
Anything add to this?
Did you try it out?
You mean play?
Like test the code to make sure it works
It looks to me as if you're using AI to generate your code, yes
its from YT and AI too
"and AI" so yes you're using AI to generate your code
I do not use that?
I won't be able to help you in that case, as you won't know how to implement the changes I suggest. Ask AI until it works or use YouTube tutorials.
Eventually maybe you'll feel up to actually learning how to script.
Can you suggest how to learn script
There are a lot of posts on this forum for that question. Look it up here and you'll find plenty of posts about it
dont use it
theres no interest in creating game when ai literally scripts everything for you
watch tutorials
it's not easy but who said it's gonna be easy
But i dont know how to make scripts
Can you suggest any way
Beginner's Roblox Scripting Tutorial #1 - Roblox Studio Basics (Beginner to Pro 2019)
Link to Beginner's Tutorial Series:
https://www.youtube.com/playlist?list=PLhieaQmOk7nIfMZ1UmvKGPrwuwQVwAvFa
Link to download Roblox Studio:
https://www.roblox.com/create
Social Media:
https://twitter.com/realtapwater
https://instagram.com/realtapwater
New...
watch
and repeat
then you can watch advanced scripting by him too
thats the way i learned
and other videos too
but this is the main source
Ok