You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? AssemblyLinearVelocity working
What is the issue? When i type in the script game.Workspace:FindFirstChild(“Maratyla10”): FindFirstChild(“HumanoidRootPart”).AssemblyLinearVelocity = Vector3.new(0, 100, 0) it doesnt work, but when i do it with command line it does work
What solutions have you tried so far? Changing the findfirstchild to torso (did the same result)
The character probably didn’t load in yet. Try this in a LocalScript:
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
hrp.AssemblyLinearVelocity = Vector3.new(0, 100, 0)
It doesn’t really matter, I chose a LocalScript because it was less code to write here and it would basically have the same effect (clients have network ownership of their characters so effects replicate, but the server would not receive the updated value).
Note to use a server script you would need to change the code.
That system is very inefficient, creates memory leaks, and comes with the issue where one player stepping on it sends all players flying. You can just use one script in the part:
local players = game:GetService("Players")
local part = script.Parent
local function onTouch(hit: BasePart): nil
local player = players:GetPlayerFromCharacter(hit.Parent)
if player then
local rootPart = hit.Parent:FindFirstChild("HumanoidRootPart", false)
rootPart.AssemblyLinearVelocity = Vector3.new(0, 100, 0)
end
end
part.Touched:Connect(onTouch)
It shouldn’t make all players jump, but it uses unnecessary memory, creates memory leaks, and it binds the event multiple times. I think the easiest thing is to create a script in the part and set the run context to client and just use the Touched event
The script would make all players jump because it creates a new connection for the .Touched event each time a player joins and essentially fires the event to all players in the game. Changing the RunContext to client on their script would have no effect because each client would fling each other locally and end up in the same result. Removing the PlayerAdded event just causes other client’s characters to be flung locally.
I was confused but I understand how it makes all players jump, but I was talking about creating a new script. Regardless of that, the AssemblyLinearVelocity should be added on to instead of being set to a constant.