Ad
Log in to vote
0

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

Asked by 13 days ago
Edited 13 days 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 13 days 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 — 12d
0
no problem :) manith513 61 — 10d
0
no problem :) manith513 61 — 10d
Ad

Answer this question