How to fix this?

So i wanted to make parts that dissapear after you step on them and when smth activates the just get instantly generate and ive also came u with a script:

local platform = script.Parent
local InRound = game.ReplicatedStorage:WaitForChild("InRound")
local isTouched = false

local function fade()
	if not isTouched then
		isTouched = true
		for count = 1, 3 do
			platform.Transparency = count / 3
			task.wait(0.1)
		end
		platform.CanCollide = false
		if InRound.Value == false then
			platform.Transparency = 0
			platform.CanCollide = true
		end
		isTouched = false
	end
end

platform.Touched:Connect(fade)

It’s still not working so i wanted to ask if there is somebody who may help me with my issue and maybe help me fix this issue by going trough it and give me some solutions for it (i’ve now been trying to fix it for about 3 hours now)!

So i wanted to make parts that dissapear after you step on them and when smth activates the just get instantly generate and ive also came u with a script:

So you’re wanting platforms that disappear when they’re stepped on and something that instantly makes them reappear? You may want to be a bit more descriptive, your issue is hard to understand

Anyways, to make the disappear when touched, just bind the Touched event to a function (which you’re already doing). Instead of making them appear after the disappear if the round is over, just check beforehand.

local isTouched = false

platform.Touched:Connect(function()
  if isTouched then return end -- Exit the event if this platform has been touched
  if inRound.Value == false then return end -- Exit the event if the round is over
  isTouched = true
  for i = 0, 1, 0.1 do
    platform.Transparency = i
    task.wait(0.1)
  end
end)

To make them reappear, you’ll have to check when inRound changes values. If inRound becomes true, make them reappear. You can do this by checking when the Value changes.

InRound:GetPropertyChangedSignal("Value"):Connect(function()
  if InRound.Value == true then
    -- Loop through every platform and make them reappear
    -- Left as an exercise for the reader
  end
end)

Better Description:
I’m having a Issue with my script where i want the part to fade out and after the round ended (When some other script deactivates the BoolValue [or what every its called]) they should be regenerating instantly!

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