So i have a button script in a part, and its just a basic Touched function-
and i coded it so it only registers a part names “Shell” but its only registering the
players parts and not the shell…
button script :
The shell has a body position, and a body gyro in it. But it is not anchored so why is it not registering???
Its also in replicated storage so i can clone() it into the workspace.
EDIT SOLVED : I’m pretty sure its because I’m moving the shell to the workspace through a local script.
It could possibly be because it’s a mesh? Maybe transform it into a mesh part. This solution might not be as ideal since it’s night and I’m a little tired
Can I ask if any error has been printed out in the Output Window when player does touch part other than your print Touched and Shell? Can I also ask if both Touched and Shell do print out when a player touches the part?
Also would recommend using local for buttoned. (local buttoned = false)
local Buttoned = false
script.Parent.Touched:Connect(function(hit)
if hit.Name == "Shell" then
print("Shell")
if Buttoned == false then
Buttoned = true
script.Parent.Parent.Bridge.CanCollide = true
script.Parent.Parent.Bridge.Transparency = 0
for i = 1,15 do
script.Parent.switch:Play()
wait(1)
end
script.Parent.Parent.Bridge.CanCollide = false
script.Parent.Parent.Bridge.Transparency = 1
end
end
end)