-
What do you want to achieve?
Hey! I am making a plugin called Cutscene Editor PRO.
So theres a button called trigger type which will be when the cutscene will play.
For now i only made 3 : Player Joined,Part Touch(once), Part Touch(unlimited)
The plugin will generate a local script which will be parented on the replicated first. -
What is the issue?
In the part touch i used random numbers to make the name of the part.
I want to know if I could parent a local script on a part, because people will just change the name of the part and it will not work.No one will not change the name of a part named 531476
Exemple of a generated script.
local data = {{CFrame = CFrame.new(0.579230547, 23.4193096, -55.8722534, -0.999949634, -0.00302518206, 0.00956970919, -0, 0.953491986, 0.301418453, -0.0100364862, 0.301403284, -0.953444004);Seconds = 3;Style = Enum.EasingStyle.Back},{CFrame = CFrame.new(39.859333, 29.0071087, 92.3271942, -0.266762465, 0.244413152, -0.932255328, -7.4505806e-09, 0.967308402, 0.253603131, 0.963762343, 0.0676518008, -0.258041531);Seconds = 5;Style = Enum.EasingStyle.Bounce},{CFrame = CFrame.new(178.612488, 121.776482, 75.6696167, -0.665622175, -0.737100899, 0.116744816, -0, 0.156433821, 0.987688422, -0.746288896, 0.657427311, -0.104125813);Seconds = 2;Style = Enum.EasingStyle.Cubic},{CFrame = CFrame.new(178.282776, 89.1894608, 76.5811234, 0.572322726, 0.80993253, -0.128280908, -7.4505806e-09, 0.1564347, 0.987688303, 0.820028484, -0.565276444, 0.0895311385);Seconds = 1.5;Style = Enum.EasingStyle.Quad},{CFrame = CFrame.new(179.289856, 84.7003021, 112.893173, -0.999887168, 0.0148362918, -0.00234985817, 2.32830644e-10, 0.156435817, 0.987688184, 0.0150212301, 0.987576723, -0.15641816);Seconds = 1.5;Style = Enum.EasingStyle.Quad},{CFrame = CFrame.new(180.408905, 58.8985443, 111.673065, -0.0174809694, 0.0608964749, 0.997991085, 1.16415322e-10, 0.998143673, -0.0609057769, -0.999847293, -0.00106469193, -0.0174485166);Seconds = 1.5;Style = Enum.EasingStyle.Quad}}
local camera = workspace.CurrentCamera
local part = game.Workspace:WaitForChild('559174') -- Created a part with a random number.
local tween = game:GetService("TweenService")
local deb = false
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild"Humanoid" then
if deb == false then
deb = true
for i,v in pairs(data) do
tween:Create(
camera,
TweenInfo.new(
v.Seconds,
v.Style,
Enum.EasingDirection.Out,
0,
false,
0
),
{CFrame = v.CFrame}
):Play()
wait(v.Seconds)
end
deb = false
end
end
end)
Exemple of the plugin :
All i want is to parent the local script to the part. I did it but it did’nt worked.
Note : The plugin script is about 800 lines so i won’t put it.
Thanks for reading