Wall Not turning off collisions?

So I am currently doing some work for a client and I cant seem to make the wall in between these two players cancollide off? this is super annoying because this has made me super behind and its not even that significant of a feature.

I need the collisions for the “RoundBlocker” to turn off when both of the bool values are true

and before you ask. No there were no errors in the output window for some odd reason just radio silence?

Here is the script inside the part that’s collisions are changing

local redspawnVal = game.Workspace.RedSpawn:FindFirstChild("PlrHere")
local bluespawnVal = game.Workspace.BlueSpawn:FindFirstChild("PlrHere")
local wall = game.Workspace.RoundBlocker

if redspawnVal == true and bluespawnVal == true then
	ifcollide()
end

function ifcollide()
	wall.CanCollide = false
end

here is the script inside both of the parts that change the bool values

local plrhere = script.Parent:FindFirstChild("PlrHere")

script.Parent.Touched:Connect(function(hit)
    plrhere.Value = true
	print("player is at red side")
end)
local plrhere = script.Parent:FindFirstChild("PlrHere")

script.Parent.Touched:Connect(function(hit)
    plrhere.Value = true
	print("player is at blue side")
end)

You’re trying to call a function that doesn’t exist at the time you try to call it. Move ifcollide above your if statement. It also will only be run once when the script first starts to exist. Is this what you’re trying to do?

local redspawnVal = game.Workspace.RedSpawn:FindFirstChild("PlrHere")
local bluespawnVal = game.Workspace.BlueSpawn:FindFirstChild("PlrHere")
local wall = game.Workspace.RoundBlocker
function ifcollide()
	wall.CanCollide = false
end

redspawnVal.Changed:Connect(function()
	bluespawnVal.Changed:Connect(function()
		if bluespawnVal.Value == true and redspawnVal.Value == true then
			ifcollide()	
		end
	end)
end)



1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.