Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[ANSWERED] How can I access a C0's original CFrame?

So, I have this local script firing a RemoteEvent inside ReplicatedStorage to the server, and there is a Script inside ServerScriptService which listens for that FireServer call, with OnServerEvent. I have 3 arguments, the Player, Action, and ... for referencing tools and all that. One of my actions are "RenderWatchMovement", what this is supposed to do is once the event is fired, it should say like: Event:FireServer("RenderWatchMovement", Toggled, Tool). All of this works, but when I try closing the watch, it does not work. This supposing bit here;

local Tool, Toggled = ...
local OriginalC0 = Tool.Base.Lid.C0
local function CloseCover()
	if CurrentTween and CurrentTween.PlaybackState == Enum.PlaybackState.Playing then
		return
	end
	local Info = {Time = 0.35, Style = Enum.EasingStyle.Sine, Direction = Enum.EasingDirection.Out}
	local Pos = OriginalC0
	TweenWeld(Tool.Base:WaitForChild("Lid"), Info, Pos)
end

What's wrong here? Well, apparently it thinks the local variable OriginalC0, is the current C0 of the Lid's C0, meaning it won't move, when I'm actually trying to get it to return to it's old C0 (Closed). Is there any other way of doing this? If so, please do elaborate and I'll enunciate on what I can do!

1 answer

Fixed, I just had to get the C0 in the local script, and place it in the FireServer function of the remote event, so it returns the C0 in the ... so then I can index it within my code.

This discussion is preserved as it was. New answers, comments, and votes are closed.