What do you want to achieve? Keep it simple and clear!
I wanna achive my dropper will work after i buy it
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:
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
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
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
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
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