-
What do you want to achieve? Keep it simple and clear!
I wanna achive my local script fire server when object name is nil(not exist) -
What is the issue? Include screenshots / videos if possible!
I don’t know why, but it says my print which means smth works wrong -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tryed to add a loops , waits and etc, still nothing
Firing script:
local RE = game.workspace.REs.FactoryCloned
local Factory = game.Workspace.Factory
local Factory1 = Factory:GetChildren()
while Factory1.Name == nil do
if Factory1.Name == "Factory1" then
RE:FireServer()
end
wait(0.5)
end
Main Script:
local DB = true
local MoneyLevel = game.workspace.Factory.MoneyLevel
local SpeedLevel = game.workspace.Factory.SpeedLevel
local Brick = game.Workspace.Factory.Factory1.Brick
local RE = game.Workspace.REs.FactoryCloned
local MainPart = game.Workspace.Factory.Factory1.MainPart
RE.OnServerEvent:Connect(function(player)
local PlrStats = player.PlayerGui:WaitForChild("PlrStats")
local FactoryBrokenValue = PlrStats.FactoryBroken
local Money = player.leaderstats.Money
local Bricks = player.leaderstats.Bricks
local BrickClone = Brick:Clone()
BrickClone.Parent = game.Workspace.Factory.Factory1.Brick
BrickClone.Transparency = 0
BrickClone.Anchored = false
BrickClone.CanCollide = true
if BrickClone.Position == Vector3.new(42.434, 10.789, -336.925) then
print("Brick Position is right!")
Bricks.Value = Bricks.Value + (1 * MoneyLevel)
BrickClone:Destroy()
print("Brick destroyed!")
end
wait(SpeedLevel)
end)
print("Smth Wrong")