Whenever an ore from a dropper is collected, the money total does not get updated on the money collector(there are no errors). When I try to change the text label’s text manually or with commands, it works so It probably isn’t a concatenation issue.
I did look somewhat briefly on the Developer Hub and on this forum, but nothing(in my opinion) was relevant. I tried adding a print statement containining the text on the (money!)collector and it did not match up with what was displayed.
I will try to explain away any confusion regarding this post so feel free to post your confusions.
-- function ore()
local Dropper = game.Workspace.Dropper1v0
local Crystal = Dropper.Crystal.Crystal
local Core = Dropper.Crystal.Core
local resetLoop = false
while true do
resetLoop = false
Crystal.Anchored = true
Core.Anchored = true
Crystal.Position = Vector3.new(-0.539, 4.493, 41.146)
Core.Position = Vector3.new(-0.539, 4.493, 41.146)
Core.Orientation = Vector3.new(0, 0, 0)
Core.Transparency = 1
Crystal.CanCollide = false
Crystal.Orientation = Vector3.new(0, 0, 0)
Crystal.Transparency = 1
Core.CanCollide = false
wait(5)
Crystal.CanCollide = true
Crystal.Position = Vector3.new(-0.539, 4.493, 41.146)
Crystal.Transparency = 0.6
Core.CanCollide = true
Core.Position = Vector3.new(-0.539, 4.493, 41.146)
Core.Transparency = 0
Crystal.Anchored = false
Core.Anchored = false
local part = Dropper.Crystal.Crystal
local Amount = game.Workspace.Collector.Display.GUI.Amount
local CurrencyToCollect = game.Workspace.Collector.Display.CurrencyToCollect.Value
local function onPartTouched(otherPart)
if otherPart == game.Workspace.Conveyor.Collector.TopLayer then
Crystal.Anchored = true
Core.Anchored = true
Core.Orientation = Vector3.new(0, 0, 0)
Core.Transparency = 1
Crystal.CanCollide = false
Crystal.Orientation = Vector3.new(0, 0, 0)
Crystal.Transparency = 1
Core.CanCollide = false
Amount = ("$"..CurrencyToCollect)
print(Amount)
resetLoop = true
end
end
part.Touched:Connect(onPartTouched)
repeat wait() until resetLoop == true
end
end
ore()
Tycoon_issue(1).wmv (1.6 MB)
The properties of the Crystal and the Core are all to move it to where it stands inside the dropper’s chute. Don’t suggest I use instantiation because this script, along with others(Not important to this topic), worked all right when the money was auto-collected.
(I don’t know how to make a gif)
Oh alright so the problem here is that you’re including the connection and function definition within the loop. You’d want them to be outside so it connects every time the part is touched.
Your error is with setting the Amount value. Assuming game.Workspace.Collector.Display.GUI.Amount is a NumberValue, when you are setting the Amount variable you would do:
I don’t understand… I don’t think that is an issue. Like I said in my first post, This script worked just fine when I used it when my tycoon auto-collected its money.
Not sure if this is it, (but it might be) your function called ore is commented out, but the end isn’t and same with the last line where it is calling the function.
That is not an error. I just had a random guess at how to properly fit the script into the first post and didn’t remove the hyphens in the middle row of the script input. In a nutshell, the commenting hyphens(-) were from the default post fill-in. They are not in the actual script.
I’m not sure what is happening, so I think the best thing you could do right now is rework the script. When you remake it, make sure not to use a loop, or an event inside of the function.
Sighhhhh… The while loop is to spawn and respawn ores from the dropper onto the conveyor belt and the touched event is to detect if the ore has reached the end of the conveyor.