#Help in my script
1 messages · Page 1 of 1 (latest)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local AnimationID = "108605383399578"
local CameraOffsetOn = Vector3.new(0, 0, 0)
local CameraOffsetOff = Vector3.new(0, 0, 0)
local WalkSpeedRightPeeked = 0 --ADJUST RightPeek SPEED HERE
local WalkSpeedStanding = 10 -- IF you using a SHIFT SPRINT or any other script, make sure walk speeds match up!!
local PlaybackSpeedRightPeeked = 0.70
local PlaybackSpeedStanding = 1
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://" .. AnimationID
local RightPeekAnimation = Humanoid:LoadAnimation(Animation)
local function setRightPeekState(isRightPeeking)
if isRightPeeking then
Humanoid.WalkSpeed = WalkSpeedRightPeeked
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOn }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedRightPeeked
Character.HumanoidRootPart.CanCollide = false
RightPeekAnimation:Play()
while wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
RightPeekAnimation:AdjustSpeed(1)
else
RightPeekAnimation:AdjustSpeed(0)
end
end
else
Humanoid.WalkSpeed = WalkSpeedStanding
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOff }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedStanding
Character.HumanoidRootPart.CanCollide = true
RightPeekAnimation:Stop()
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then --buttons to RightPeek HERE ( make sure to change it on line 55 too)
setRightPeekState(true)
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons (make sure they match to the line above^^)
setRightPeekState(false)
end
end
end)
here
can you teach me how to make this?
when the player left peek. the camera goes left a little.
and i have a question. when the player peek. the peek animations works to the server or only the player? i put this code in a localscript inside starter-character-scripts
- this
@paper mauve
u literally said u want ppl to add smthn
animations replicate to the whole server
alr
@crude cave
Lemme handle ts first
..
Wait a min…
@crude cave
u got td
Ts
XD
lol
the humanoid has a Vector3 property called CameraOffset, you should just change this value when you want it to peek left or right
Vector3.new(-1, 0, 0) for left, Vector3.new(1, 0, 0) for right
and then just set it to 0 when you dont want it to peek
alr wait i will try
How does
Humanoid have position
its called a cameraoffset
There’s a camera offset in humanoid?
Oh
so it can position the camera
Vector3.fromRGB(255,0,0)
Vector3.new
doesnt work. i put it here
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then --buttons to RightPeek HERE ( make sure to change it on line 55 too)
setRightPeekState(true)
Vector3.new(1, 0, 0)
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons (make sure they match to the line above^^)
setRightPeekState(false)
Vector3.new(0, 0, 0)
end
end
end)
Isn’t that color
Try this
im obv joking fatass
Oh
its okay I forgive your ignorance <3
@crude cave
wadafack
both are T
wdym
both are using keycode T
yh its when he click on T the pose = true. and when he release. = false
@paper mauve
.
u just put vector3 bro
yea
i did. it doesnt work
u didnt even change the camera offset
u didnt even manipulate the cameraoffset
but it wont be smooth
see. i didnt learn cameraoffset yet. so i am dumb in these things
to let yk
how to make it smooth then?
tween
ye
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then --buttons to RightPeek HERE ( make sure to change it on line 55 too)
setRightPeekState(true)
Vector3.new(1, 0, 0)
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons (make sure they match to the line above^^)
setRightPeekState(false)
Vector3.new(0, 0, 0)
end
end
end)
i marked it for yall
Humanoid.CameraOffset = Vector3.new(0,0,0)
as example
and still doesnt work
u forgot to put Humanoid.CameraOffset
oh wait

wait aint it like that
Humanoid.CameraOffset = Vector3.new(1, 0, 0)
this also doesnt work
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local AnimationID = "108605383399578"
local CameraOffsetOn = Vector3.new(0, 0, 0)
local CameraOffsetOff = Vector3.new(0, 0, 0)
local WalkSpeedRightPeeked = 0 --ADJUST RightPeek SPEED HERE
local WalkSpeedStanding = 10 -- IF you using a SHIFT SPRINT or any other script, make sure walk speeds match up!!
local PlaybackSpeedRightPeeked = 0.70
local PlaybackSpeedStanding = 1
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://" .. AnimationID
local RightPeekAnimation = Humanoid:LoadAnimation(Animation)
local function setRightPeekState(isRightPeeking)
if isRightPeeking then
Humanoid.WalkSpeed = WalkSpeedRightPeeked
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOn }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedRightPeeked
Character.HumanoidRootPart.CanCollide = false
RightPeekAnimation:Play()
while wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
RightPeekAnimation:AdjustSpeed(1)
else
RightPeekAnimation:AdjustSpeed(0)
end
end
else
Humanoid.WalkSpeed = WalkSpeedStanding
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOff }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedStanding
Character.HumanoidRootPart.CanCollide = true
RightPeekAnimation:Stop()
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then --buttons to RightPeek HERE ( make sure to change it on line 55 too)
setRightPeekState(true)
Humanoid.CameraOffset = Vector3.new(1, 0, 0)
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons (make sure they match to the line above^^)
setRightPeekState(false)
Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end
end
end)
here is my code. idk whats wrong
@stuck zodiac
it was a crouch script first. i watched a tut from yt. but i am changing it to peek script
ah
i duplicated it. one for left and one for right
ur script has no problem lol
u just forgot to input the vector3
here
wait
both Vectors were 0,0,0
thats why it didnt work
wait a sec
do i have to put ON and Off?
look
ON is when u press T
so it goes right
OFF is when u release T
so it goes to normal
so ON is 1,0,0
alr wait i will test
@stuck zodiac
btw let this thread open. i gtg. when i am back we will continue. i am back at 5:20 pm. its 3:27 pm rn in my timexone
zone*
@stuck zodiac cya
why me 
i'll check on this tomorrow but for the moment, bruh, this code: ```lua
local function setRightPeekState(isRightPeeking)
if isRightPeeking then
Humanoid.WalkSpeed = WalkSpeedRightPeeked
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOn }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedRightPeeked
Character.HumanoidRootPart.CanCollide = false
RightPeekAnimation:Play()
while wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
RightPeekAnimation:AdjustSpeed(1)
else
RightPeekAnimation:AdjustSpeed(0)
end
end```
what on earth is that while loop doing? it literally runs forever! even if it errors!
why 
HUH
You...
did not answer my question 
that's a good question too but that wasn't the question i meant ;p
have you ever thought about understanding and making it yourself
actual s3 tier deductive reasoning skills
"i did nothing and its doing the exact same thing as last time"
dang i take that back, s4 tier deductive reasoning skills
...
...,lkjuytrewqweedfghj,kmjnhgfd4scedrtfhujio[p;]';[plkjwaethujikopijuhygtf6r5detfhyui0o-p[
';juhygfdsasdfghjkl;'
kjhgfdsdfghjkl;'
anywayyy if youre right peeking, start an infinite loop
and it stacks
just rewrite your script
trust
HAVE YOU EVER PLAYED BLOX FRUITS WITH YOUR LIFE ON THE LINE?
@stuck zodiac
show the script
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local AnimationID = "108605383399578"
local CameraOffsetOn = Vector3.new(0, 0, 0)
local CameraOffsetOff = Vector3.new(0, 0, 0)
local WalkSpeedRightPeeked = 0 --ADJUST RightPeek SPEED HERE
local WalkSpeedStanding = 10 -- IF you using a SHIFT SPRINT or any other script, make sure walk speeds match up!!
local PlaybackSpeedRightPeeked = 0.70
local PlaybackSpeedStanding = 1
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://" .. AnimationID
local RightPeekAnimation = Humanoid:LoadAnimation(Animation)
local function setRightPeekState(isRightPeeking)
if isRightPeeking then
Humanoid.WalkSpeed = WalkSpeedRightPeeked
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOn }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedRightPeeked
Character.HumanoidRootPart.CanCollide = false
RightPeekAnimation:Play()
while wait() do
if Humanoid.MoveDirection.Magnitude > 0 then
RightPeekAnimation:AdjustSpeed(1)
else
RightPeekAnimation:AdjustSpeed(0)
end
end
else
Humanoid.WalkSpeed = WalkSpeedStanding
TweenService:Create(Humanoid, TweenInfo.new(0.25), { CameraOffset = CameraOffsetOff }):Play()
Character.HumanoidRootPart.Running.PlaybackSpeed = PlaybackSpeedStanding
Character.HumanoidRootPart.CanCollide = true
RightPeekAnimation:Stop()
end
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons to RightPeek HERE ( make sure to change it on line 55 too)
setRightPeekState(true)
Humanoid.CameraOffsetOn = Vector3.new(1, 0, 0)
end
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.T then -- buttons (make sure they match to the line above^^)
setRightPeekState(false)
Humanoid.CameraOffsetOff = Vector3.new(0, 0, 0)
end
end
end)
@stuck zodiac