CodyyBlox
(CodyyBlox)
October 9, 2021, 1:52pm
#1
local ClickDetector = script.Parent.ClickDetector
local Door = script.Parent.Parent.Door
local TweenService = game:GetService(“TweenService”)
local Info = TweenInfo.new(
2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
true,
0
)
local Goal =
{
Position = Vector3.new(Door.Position.X +0, Door.Position.Y -6, Door.Position.Z +0)
}
local MoveDoor = TweenService:Create(Door, Info, Goal)
ClickDetector.MouseClick:Connect(function()
MoveDoor.play(MoveDoor)
end)
I cant figure out where the flaw is please help!
LMVM2041
(League)
October 9, 2021, 1:56pm
#2
CodyyBlox:
MoveDoor.play(MoveDoor)
It’s actually:
MoveDoor:Play()
Don’t include anything in the brackets.
CodyyBlox
(CodyyBlox)
October 9, 2021, 1:59pm
#3
I have tried this before and it doesnt seem to be a solution.
LMVM2041
(League)
October 9, 2021, 2:03pm
#4
Are there any errors in your output?
Couldn’t understand your script since it wasn’t formatted properly, so here’s a cleaner version:
local TweenService = game:GetService(“TweenService”)
local ClickDetector = script.Parent.ClickDetector
local Door = script.Parent.Parent.Door
local Info = TweenInfo.new(
2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
true,
0
)
local Goal = {
Position = Vector3.new(Door.Position.X +0, Door.Position.Y -6, Door.Position.Z +0)
}
local MoveDoor = TweenService:Create(Door, Info, Goal)
ClickDetector.MouseClick:Connect(function()
MoveDoor.play(MoveDoor)
end)
So, first of all. It’s not MoveDoor.play(MoveDoor)
Should be MoveDoor:Play()
Again, you did mention it didn’t work. Then try adding a print on the MouseClick event?
ClickDetector.MouseClick:Connect(function()
print("Playing tween..")
MoveDoor:Play()
end)
Then next, are you sure the Door variable is a part?
CodyyBlox
(CodyyBlox)
October 9, 2021, 2:14pm
#7
Right now it is grouped, will that affect it?
Could you show your explorer to make it clearer?
That explains it. You messed up your Ancestor placement.
It should be
local Door = script.Parent.Parent.Parent.Parent.Door
And for the door tweening, not going to do all the stuff. Here’s a video on it.
If there’s still any problems then let me know!
CodyyBlox
(CodyyBlox)
October 9, 2021, 2:23pm
#11
Oh my god I didn’t even notice, I guess I didn’t think much about adding it so far down there.
1 Like
Here’s more of a shorter version:
local Door = script:FindFirstAncestor("BlastDoor").Door
1 Like
CodyyBlox
(CodyyBlox)
October 9, 2021, 2:27pm
#13
It isn’t printing the print(“Playing tween…”) when I click.
Weird
Try printing ClickDetector.Name instead?
CodyyBlox
(CodyyBlox)
October 9, 2021, 2:32pm
#15
That’s the script so far for reference.
Have you checked the output on what’s printing or not?
And also it’s :Play()
not :play()
CodyyBlox
(CodyyBlox)
October 9, 2021, 2:36pm
#17
They “Play” didn’t fix the problem and it isn’t outputting anything since I started today.
Mind sending a picture of the output, after clicking?
Yeah, Position isn’t a valid property of a Model. Watch the video I sent. It’ll fix your problem.
1 Like