You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m making an indie roblox horror game, and am currently scripting for the chase sequence. At this point, I’m making the end animation for the chase, to do this i use a trigger part with no collision, which fires a RemoteEvent from a server script, then going to a localscript which organizes the animations. Both scripts will be attached. -
What is the issue? Include screenshots / videos if possible!
At the end of the chase, the main character gets pushed off of a cliff and into water, by a separate rig. The main character’s animation works fine, but due to what I believe is the collisions, the monster (just a normal r6 rig) is smacking into a wall, thus messing up the animation.
Another little detail is the way the main rig flings at the end.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have already made a dev forum post, but i decided to make a new one that’s a little more in depth, as no-one way replying to the last one.
I also got chat gpt to analyze my code, but that was not much help as usual.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
PhaseTwoStarter - Server Script Located In The Trigger Part.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Event = ReplicatedStorage.Remotes:WaitForChild("ChasePhaseTwo")
local DisableEvent = ReplicatedStorage.Remotes:WaitForChild("DisableControls")
local EnableEvent = ReplicatedStorage.Remotes:WaitForChild("EnableControls")
local debounce = {}
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(character)
if player and character:FindFirstChild("Humanoid") and not debounce[player] then
debounce[player] = true
-- Disable controls and trigger phase two
DisableEvent:FireClient(player)
Event:FireClient(player)
-- Move player
character:MoveTo(workspace.PlayerHide.Position)
-- Wait and trigger phase two again
task.wait(20)
Event:FireClient(player)
-- Optional: Re-enable controls after phase
EnableEvent:FireClient(player)
-- Remove debounce after some time if needed
task.wait(5)
debounce[player] = nil
end
end)
Phase Two Handler - LocalScript in StarterPlayerScripts
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local Event = ReplicatedStorage.Remotes:WaitForChild("ChasePhaseTwo")
local Characters = ReplicatedStorage:WaitForChild("EndChaseAnimation")
local John = Characters:WaitForChild("NaughtyJohn")
local Main = Characters:WaitForChild("PlayerModel")
local spawnLocation = workspace:WaitForChild("ChaseStartPosition") -- A part you place manually in workspace
local ChaseTriggerer = workspace:WaitForChild("ObjectiveParts"):WaitForChild("ChasePhaseTwo")
Event.OnClientEvent:Connect(function()
-- Ensure spawn location exists
if not spawnLocation then
warn("ChaseStartPosition not found in workspace!")
return
end
ChaseTriggerer:Destroy()
-- Move models into workspace
Characters.Parent = workspace
-- Set starting positions
local basePosition = spawnLocation.Position
-- Set Player (Main) facing the same direction as the part
Main:SetPrimaryPartCFrame(CFrame.new(basePosition, basePosition + spawnLocation.CFrame.LookVector))
-- Set John behind the player, facing the same direction as the part
local johnPosition = basePosition - spawnLocation.CFrame.LookVector -- John 5 studs behind
John:SetPrimaryPartCFrame(CFrame.new(johnPosition, johnPosition + spawnLocation.CFrame.LookVector))
-- Load animations
local JohnAnim = script:WaitForChild("John")
local MainAnim = script:WaitForChild("Player")
local JohnHumanoid = John:WaitForChild("Humanoid")
local MainHumanoid = Main:WaitForChild("Humanoid")
local JohnAnimTrack = JohnHumanoid:LoadAnimation(JohnAnim)
local MainAnimTrack = MainHumanoid:LoadAnimation(MainAnim)
-- Set animation priority
JohnAnimTrack.Priority = Enum.AnimationPriority.Movement
MainAnimTrack.Priority = Enum.AnimationPriority.Movement
-- Set camera to follow PlayerModel and adjust distance (Optional)
camera.CameraSubject = Main:WaitForChild("Torso")
camera.CameraType = Enum.CameraType.Custom
camera.CFrame = camera.CFrame * CFrame.new(0, 5, -10) -- Adjust as needed
-- Play animations
JohnAnimTrack:Play()
MainAnimTrack:Play()
MainAnimTrack.Ended:Connect(function()
camera.CameraSubject = player.Character:FindFirstChild("Torso")
end)
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.