로비에서 푼 이동(WalkAcceleration)이 텔레포트 후 전투맵에 누설돼도 PlayerLock이 맵 로드 시 0으로 재설정해 확실히 잠금. 정찰로 WalkAcceleration이 실제 이동 레버임을 확인. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
{
|
|
"Id": "",
|
|
"GameId": "",
|
|
"EntryKey": "codeblock://playerlock",
|
|
"ContentType": "x-mod/codeblock",
|
|
"Content": "",
|
|
"Usage": 0,
|
|
"UsePublish": 1,
|
|
"UseService": 0,
|
|
"CoreVersion": "26.5.0.0",
|
|
"StudioVersion": "",
|
|
"DynamicLoading": 0,
|
|
"ContentProto": {
|
|
"Use": "Json",
|
|
"Json": {
|
|
"CoreVersion": {
|
|
"Major": 0,
|
|
"Minor": 2
|
|
},
|
|
"ScriptVersion": {
|
|
"Major": 1,
|
|
"Minor": 0
|
|
},
|
|
"Description": "",
|
|
"Id": "PlayerLock",
|
|
"Language": 1,
|
|
"Name": "PlayerLock",
|
|
"Type": 1,
|
|
"Source": 0,
|
|
"Target": null,
|
|
"Properties": [
|
|
{
|
|
"Type": "number",
|
|
"DefaultValue": "0",
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": "LockTries"
|
|
}
|
|
],
|
|
"Methods": [
|
|
{
|
|
"Return": {
|
|
"Type": "void",
|
|
"DefaultValue": null,
|
|
"SyncDirection": 0,
|
|
"Attributes": [],
|
|
"Name": null
|
|
},
|
|
"Arguments": [],
|
|
"Code": "self.LockTries = 0\nlocal eventId = 0\nlocal function apply()\n\tself.LockTries = self.LockTries + 1\n\tlocal pc = nil\n\tlocal lp = _UserService.LocalPlayer\n\tif lp ~= nil then\n\t\tpc = lp.PlayerControllerComponent\n\tend\n\tif pc ~= nil then\n\t\tpc.LookDirectionX = 1\n\t\tpc.FixedLookAt = true\n\t\tpc.Enable = false\n\tend\n\tif lp ~= nil and lp.RigidbodyComponent ~= nil then\n\t\tlp.RigidbodyComponent.WalkAcceleration = 0\n\tend\n\tif pc ~= nil then\n\t\t_TimerService:ClearTimer(eventId)\n\telseif self.LockTries > 30 then\n\t\t_TimerService:ClearTimer(eventId)\n\tend\nend\neventId = _TimerService:SetTimerRepeat(apply, 0.1)",
|
|
"Scope": 2,
|
|
"ExecSpace": 6,
|
|
"Attributes": [],
|
|
"Name": "OnBeginPlay"
|
|
}
|
|
],
|
|
"EntityEventHandlers": []
|
|
}
|
|
}
|
|
} |