Simple Event Not Performing

So I put this event together, and I think I’m missing something really simple to make it work. This script would be in the “Part” in Workspace.

local function Run()
	if
		game.Workspace.Part.Transparency == 0 then
		game.Workspace.Part.Transparency = .1
	end
end

game.Workspace.Part.Touched:Connect(Run)

local function Running()
	
	game.Workspace.Part.Anchored = false
	
end

game.Workspace.Part.Touched:Connect(Running)

print("Working?")

local function Run()
	if game.Workspace.Part.Transparency == 0 then
		game.Workspace.Part.Transparency = .1
	end
        
	game.Workspace.Part.Anchored = false
end

game.Workspace.Part.Touched:Connect(Run)



print("Working?")``


Try this

I also suggest you to check if the object that touched the brick is a player.

So, basically, I just need to condense it because I really did not need two functions?

From memory, you can’t call two functions from a single event like that.
You have to call the second function within the first function

In this case, you didnt really need to use 2 functions, plus -

If you wanted to use 2 functions,you could do that, but call one of them inside the other one.

Ahh, okay. So I would just place the other function, if I needed to inside, before the last end?

You would make a function , and inside of it - call the first one , and use that one( the second one) later to do what you need.

I answered this already, but ok…

local function Second()

end

local function First()
    Second()
end

script.Parent.Touched:Connect(First)

Well I thank you both for the help, I really appreciate it. Have a blessed day guys.

1 Like