What do you want to achieve? Simply get my elevator to work for a Star Wars RP.
What is the issue? ``local debounce = false
local Touched = script.Parent
script.Parent.Touched:connect(function(Touched)
if Touched.Parent:FindFirstChild(“Humanoid”) then
if not debounce then
debounce = true
for i = 1,30 do
script.Parent.CFrame = CFrame.new(script.Parent.Position + Vector3.new(0,0.562,0))
wait(0.0001)
end
wait(2)
debounce = false
end
end
end)``
That is my script.
Inside the explorer:
What solutions have you tried so far? I tried to switch up the script, mess with the group. I don’t know if the union is messing the script up
That error is necessary information for the post. Your issue is your script is parented to a model. Models do not have a .Touched event, or a .CFrame property. You’ll have to use .Touched on a seperate part inside of the elevator, and use SetPrimaryPartCFrame for moving the model.
I don’t recommend using CFrame for elevators, since players will not move with it. Using constraints is what I personally do but any physics-based solution will work too.
I wouldn’t recommend doing touched on all parts, as you’d only want the elevator to move when you’re on the top of it. Maybe an invisible part that detects you’ve entered somewhere in the middle of the upper platform, indicating a player is on the elevator, and not beside it.