Script Change/Edit

Hello!

I am trying to make a Mine for my tycoon. I have a new tycoon kit that is completely differently coded to my old one. My new tycoon kit requires a different dropper script. As my new tycoon kit does not come with a Mine script, I have to edit the script myself, which I could usually do, but clearly not for this.

image
^^^
That image shows the new dropper script.


^^^
That image shows the mine drop script. It is a completely different code/system.

I have tried to copy the click detector line from the original script into the new one, but I am unsure as to where to put it. I am sure this would be a 10 second job for a scripter.

Thank you!

1 Like

(OLD DROPPER SCRIPT)

-- debounce = false
script.Parent.Button.ClickDetector.MouseClick:connect(function()
	if debounce == false then
		debounce = true
		script.Parent.Button.BrickColor=BrickColor.new("Bright red")
		local part = Instance.new("Part",workspace)
		local cash = Instance.new("IntValue",part)
		cash.Name = "Cash"
		part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
		cash.Value = 10
		part.CFrame = script.Parent.Drop.CFrame
		part.Size=Vector3.new(1,1,1)
		game.Debris:AddItem(part,20)
		wait(0.2) -- Time to wait in between clicks
		debounce = false
		script.Parent.Button.BrickColor=BrickColor.new("Bright green")
	end
end)


(NEW DROPPER SCRIPT)

if script.Parent.Dropper.Value.Parent.Parent.Parent.Properties.Owner.Value ~= nil then
    while true do
        local dropperProp = script.Parent.Dropper.Value
        local part = Instance.new("Part"); part.Size = Vector3.new(.5,.5,.5); part.Position = script.Parent.dropPos.WorldPosition
        part.CollisionGroupId = 1
        local sMesh = Instance.new("SpecialMesh"); sMesh.MeshId = dropperProp.MeshId.Value; sMesh.TextureId = dropperProp.TextureId.Value; sMesh.Scale = dropperProp.sizeMesh.Value; sMesh.Parent = part;
        local cash = Instance.new("NumberValue"); cash.Name = "Cash"; cash.Value = dropperProp.Cash.Value; cash.Parent = part
        local cashSaver = game:GetService("ServerStorage").cashSaver:Clone(); cashSaver.Parent = part
        part.Parent = dropperProp.Parent.Parent.Parent.tycoonThings.dropFolder
        cashSaver.Disabled = false
        wait(script.Parent.dropTime.Value)
    end
end

What exactly do you mean? Like are you trying to find a place for the ClickDetector line?

in this script part, i assume youre talking about where to put it so:

script.Parent.MouseClick:Connect(function() -- This line on top so the Start
	-- Code stuff here
end) -- The end

image

I am trying to put the new dropper script into the mine so that it works. for example, I want the button to turn red, and then green once dropped.

like the old mine, but with the new system.

Here is a script that i made, i added a delay:

local Activated = false

script.Parent.MouseClick:Connect(function()
	if not Activated then
		Activated = true
		script.Parent.Parent.BrickColor = BrickColor.new("Really red")
		local P = Instance.new("Part", workspace)
		P.Position = script.Parent.Parent.Position + Vector3.new(0,5,2)
		
		
		wait(1) -- Delay, Increase or Decrease if you want.
		Activated = false
		script.Parent.Parent.BrickColor = BrickColor.new("Lime green")
end
end)
1 Like

I’m confused, what do you want me to do with that? It doesn’t include my new system thingy

Please, Explain, this is what im trying to help with

dont send a screenshot of your code. add ``` for it and then copy it

okay so my new drop script (that was retrieved from a DROPPER) does not come with a Mine script.
It has a new system, it uses a folder instead of a leaderboard for cash.

Wheras my old tycoon did have a mine, it uses the old leaderboard drop script. I am trying to make a Mine by copying the new script into the old one, and trying to add the click detector. I also want the button to turn red and then green once pressed.

Is your Variable a Part or a UI?

edit: Stupid Question

Would you like to help me for some Robux? As a commission, if you’re down.

We can take this to DM’s if you’d like.

I don’t exactly do commissions, idk, i guess? Im not a great scripter but i might be able to help, i dont exactly like people giving robux to me because i help them.

Cool, what would you like me to DM you on?

Did you make the scripts? They are not supposed to work the same way. The old one presumably requires the player to click on a part in order for some “ore” (I assume) to spawn, while the new one just has an infinite loop that spawns these ores automatically.

If you want the new script to behave similarly to the old script, I would probably replace the while loop with the click detector event. However, I’m unsure what you are actually trying to achieve. Perhaps this?:

script.Parent.Button.ClickDetector.MouseClick:connect(function()
    local dropperProp = script.Parent.Dropper.Value
    local part = Instance.new("Part"); part.Size = Vector3.new(.5,.5,.5); part.Position = script.Parent.dropPos.WorldPosition
    part.CollisionGroupId = 1
    local sMesh = Instance.new("SpecialMesh"); sMesh.MeshId = dropperProp.MeshId.Value; sMesh.TextureId = dropperProp.TextureId.Value; sMesh.Scale = dropperProp.sizeMesh.Value; sMesh.Parent = part;
    local cash = Instance.new("NumberValue"); cash.Name = "Cash"; cash.Value = dropperProp.Cash.Value; cash.Parent = part
    local cashSaver = game:GetService("ServerStorage").cashSaver:Clone(); cashSaver.Parent = part
    part.Parent = dropperProp.Parent.Parent.Parent.tycoonThings.dropFolder
    cashSaver.Disabled = false
    wait(script.Parent.dropTime.Value)
end)

It would be very helpful if you could actually explain what the scripts are supposed to do.