im trying to do a thing where a local script calls an event when mouse3 is pressed it should open a door but only if you are touching a certain part
local callDoor = game.ReplicatedStorage:WaitForChild("callDoor") local anim = script:WaitForChild("Animation") local hum = script.Parent:WaitForChild("Humanoid") local playanim = hum:LoadAnimation(anim) local clickArea = script.Parent.ClickArea callDoor.OnServerEvent:Connect(function() --i need help here end)
any help? :)
local part = whereisit local woop = false for i,v in pairs(part:GetTouchingParts()) do if game.Players:FindFirstChild(v.Parent.Name) then woop = true end end if woop == true then return true else return false end