所以我对脚本一无所知,我正在从一个大佬变成一个大亨,我需要关于参数 3 缺失或 nil 的帮助,这里是代码
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local Rng = Random.new()
local function AnimateBuild(Model)
for _, v in Model:GetDescendants() do
if v:IsA("BasePart") or v:IsA("UnionOperation") then
local OriginalCFrame = v.CFrame
local OriginalSize = v.Size
local OriginalTransparency = v.Transparency
local PositionOffset = Vector3.new(Rng:NextNumber(-2, 2), Rng:NextNumber(-2, 2))
local RotationOffset = CFrame.Angles(Rng:NextNumber(-3, 3), Rng:NextNumber(-3, 3))
v.CFrame = v.CFrame * CFrame.new(PositionOffset) * RotationOffset
v.Transparancy = 1
TweenService:Create(v, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {CFrame = OriginalCFrame}):Play()
TweenService:Create(v, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Transparency = OriginalTransparency}):Play()
end
end
end
Remotes:WaitForChild("BuildAnimation").OnClientEvent:Connect(function(Model)
print("CALLED ANIMATION")
AnimateBuild(Model)
end)
我不知道该怎么办
Vector3.new
和CFrame.Angles
都期望三(3)number参数。您只需为每个人提供两个 (2) 个号码:
local PositionOffset = Vector3.new(Rng:NextNumber(-2, 2), Rng:NextNumber(-2, 2))
local RotationOffset = CFrame.Angles(Rng:NextNumber(-3, 3), Rng:NextNumber(-3, 3))