Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problem with a part not turning off cancollide with a localscript?

Asked by 2 years ago
Edited 2 years ago

So i have this script but its server side, the script makes it so when you touch the part with the script in it the other part named wall getts its cancollide turned off. But i need it to work client side. So I put it in a local script but it does not work. Can someone help me?

Heres the script:

local part = script.Parent
local wall = script.Parent.Parent:WaitForChild("Wall")

local function Disappear()
    wall.CanCollide = false
    wait(3)
    wall.CanCollide = true
end

part.Touched:Connect(Disappear)

I need it so the wall has its can collide turned off for just the client. not the server.

1 answer

Log in to vote
0
Answered by
manith513 121
2 years ago

Use a remote event that fires to the client you want cancollide turned off for. In a local script, set it where when the remote event is fired, it does whatever you want. (In this case setting the cancollide of a part to true or false.)

0
thank you!! tonomeow 5 — 2y
0
no problem :) manith513 121 — 2y
0
no problem :) manith513 121 — 2y
Ad

Answer this question