Dropper don't work after i bought it

  1. What do you want to achieve? Keep it simple and clear!
    I wanna achive my dropper will work after i buy it

  2. What is the issue? Include screenshots / videos if possible!
    issue is, after i buy dropper it don’t works, dropper ore is just anchored(i made that to make part don’t move before dropper bought) . All script also don’t work, idk why , here is screenshot:
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i tryed to remove some lines of code which make part anchored and script work if main part of dropper is transparency 0. Also i tryed to use repeat/until.Idk if that possible to find in devhub/youtube

Here is script:

local MoneyLevel = script.Parent.Parent.Parent.MoneyLevel
local SpeedLevel = script.Parent.Parent.Parent.SpeedLevel
local MainPart = script.Parent.Parent.MainPart
local DB = true
script.Parent.Anchored = true
if MainPart.Transparency == 0 then
if MoneyLevel.Value == 0 then
	if SpeedLevel.Value == 0 then
			while true do
				script.Parent.Anchored = false
wait(0.8)
			script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
	local PlrBricks = script.Parent.Parent.PlayerBricks
	PlrBricks.Value = PlrBricks.Value + 1
			script.Parent.Anchored = true
			script.Parent.Transparency = 1
			wait(3)
			script.Parent.Anchored = false
				script.Parent.Transparency = 0
				end
		end
	end
	end
if MainPart.Transparency == 0 then
if SpeedLevel.Value == 1 then
	if MoneyLevel.Value == 0 then
			while true do
				script.Parent.Anchored = false
		wait(0.8)
			script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
		local PlrBricks = script.Parent.Parent.PlayerBricks
		PlrBricks.Value = PlrBricks.Value + 1
		script.Parent.Anchored = true
		script.Parent.Transparency = 1
		wait(2)
		script.Parent.Anchored = false
		script.Parent.Transparency = 0
	end
	end
	end
end
if MainPart.Transparency == 0 then
if SpeedLevel.Value == 1 then
	if MoneyLevel.Value == 1 then
			while true do
				script.Parent.Anchored = false
			wait(0.8)
			script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
			local PlrBricks = script.Parent.Parent.PlayerBricks
			PlrBricks.Value = PlrBricks.Value + 2
			script.Parent.Anchored = true
			script.Parent.Transparency = 1
			wait(2)
			script.Parent.Anchored = false
			script.Parent.Transparency = 0
			end
			end
	end
	end

That’s a lot of unnecessary if statements, couldn’t you just encase all of them within one?

Are there any errors on the Output at all?

No there is no errors in output

Jk i use them for upgrades, Like speed upgrade or money multiplier upgrade, and one for disabling script before dropper bought

You could just simply add print statements for debugging that’ll let you know what exactly doesn’t work:

print("This should work 100%, if it doesn't then the script is disabled")

local MoneyLevel = script.Parent.Parent.Parent.MoneyLevel
local SpeedLevel = script.Parent.Parent.Parent.SpeedLevel
local MainPart = script.Parent.Parent.MainPart
local DB = true
script.Parent.Anchored = true
if MainPart.Transparency == 0 then
	print("Part is visible")
	if MoneyLevel.Value == 0 then
		print("MoneyLevel is 0")
		
		if SpeedLevel.Value == 0 then
			print("SpeedLevel is 0")
			
			while true do
				print("This loop is properly working")
				script.Parent.Anchored = false
				wait(0.8)
				script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
				local PlrBricks = script.Parent.Parent.PlayerBricks
				PlrBricks.Value = PlrBricks.Value + 1
				script.Parent.Anchored = true
				script.Parent.Transparency = 1
				wait(3)
				script.Parent.Anchored = false
				script.Parent.Transparency = 0
			end
		end
	end
end
if MainPart.Transparency == 0 then
	print("Part is visible")

	if SpeedLevel.Value == 1 then
		print("SpeedLevel is 1")

		if MoneyLevel.Value == 0 then
			print("MoneyLevel is 0")

			while true do
				print("This other loop is properly working")
				script.Parent.Anchored = false
				wait(0.8)
				script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
				local PlrBricks = script.Parent.Parent.PlayerBricks
				PlrBricks.Value = PlrBricks.Value + 1
				script.Parent.Anchored = true
				script.Parent.Transparency = 1
				wait(2)
				script.Parent.Anchored = false
				script.Parent.Transparency = 0
			end
		end
	end
end

if MainPart.Transparency == 0 then
	print("Part is visible")

	if SpeedLevel.Value == 1 then
		print("SpeedLevel is 1")

		if MoneyLevel.Value == 1 then
			print("MoneyLevel is 1")

			while true do
				print("This other OTHER loop is properly working")

				script.Parent.Anchored = false
				wait(0.8)
				script.Parent.Position = Vector3.new(42.434, 10.85, -335.235)
				local PlrBricks = script.Parent.Parent.PlayerBricks
				PlrBricks.Value = PlrBricks.Value + 2
				script.Parent.Anchored = true
				script.Parent.Transparency = 1
				wait(2)
				script.Parent.Anchored = false
				script.Parent.Transparency = 0
			end
		end
	end
end
1 Like

Okay lemme add and see what’s wrong

2 Likes

Okay i see the error, line of code if MainPart.Transparency == 0 then not working, even if mainpart is transparency 0

But i still have no idea why script don’t detect mainpart transparency, if i remove that line of code everything works

1 Like

Try printing the Transparency of the MainPart to double check

print(MainPart.Transparency) --Should be outputted back as a decimal/float

If it’s 0, then my potential guess is that you could be handling it on the client or something?

Hmm i using script not local script, maybe this can cause error?

Hmm i can’t add it to dropper script, so i need add it to button script, it’s says me what transparency is 0, that’s odd

I don’t think that’d be the case, provided you handle it on the server it should work just fine

Wait, why couldn’t you add it to that script?

Because i can get right transparency only after buy dropper(factory) button touched, and i can’t put it anywhere, it will just print me transparency 1. And i can’t put it in factory script, because it’s stops on if MainPart.Transparency == 0 then

Wait

Is the whole Dropper invisible as it is before you even purchase it with the button? You could just simply put it inside ServerStorage instead & clone it that way if that’s the case, as all scripts inside the workspace would just run the moment you hit Play/Run

Ehmmm a bit hard for me, + i have much details and it’s hard to figure their original positions

Btw amma will try it, i will write if this will help

Hmm wait, can i clone a whole model, or only parts?

You can clone models (Which are also Instances), just when you purchase the Dropper with your button replace your current script with this (Don’t remove the check that’ll make it purchase though):

local Dropper = game.ServerStorage.Dropper:Clone()
Dropper.Parent = workspace
Dropper:MakeJoints()

You don’t even need to set its position if you’re just setting it in the same spot every time

Jk as i see i can’t clone whole model, i can’t set it position

Oh thanks i will test that script