-
What do you want to achieve? Keep it simple and clear!
I wanna achieve my upgrade button works -
What is the issue? Include screenshots / videos if possible!
Issue is odd, because yesterday that script worked fine, now it’s don’t, also i getting weird error in output from strange script(even don’t know what script it is). Here is screenshoots:


-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tryed to load my yesterday version, but still no works. This impossible to find that on devhub/youtube lol, it’s most like a studio glitch, bec it worked yesterday
Here is script:
--Upgrade button script
local SpeedLevel = workspace.Factory.SpeedLevel
local PlayerMoney = workspace.Factory.PlayerMoney
if PlayerMoney.Value >= 1 then
if SpeedLevel.Value == 0 then
script.Parent.Touched:Connect(function()
SpeedLevel.Value = SpeedLevel.Value + 1
script.Parent:Destroy()
end)
end
end
And here is odd script:
local larm = script.Parent:FindFirstChild("Left Arm")
local rarm = script.Parent:FindFirstChild("Right Arm")
function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = 1000
local temp = nil
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Torso")
human = temp2:findFirstChild("Humanoid")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
end
while true do
wait(math.random(1,5))
--local target = findNearestTorso(script.Parent.Torso.Position)
--if target ~= nil then
-- script.Parent.Zombie:MoveTo(target.Position, target)
--end
script.Parent.Humanoid:MoveTo(Vector3.new(math.random(-100,100),0,math.random(-100,100)), game.Workspace.Base)
end
idk what’s script is that, i tested game on viruses 50 times, i have good anti-virus

