#💬 orettyʹs Feedback
1 messages · Page 1 of 1 (latest)
hi could you help me replicate this ?
i'd like to do something similar with the hands system, i'd appreciate some explanation on how you did it
@dire carbon thank you
oh yea man its literally just some sprites i stole from the Schism mod for doom II
the mods usualy have them as seperate images, this is one sheet i put together
just use the image label rect offset property to show one sprite at a time
basically you just have 1 sheet with every state in it, each sprite/state/mini-image is arranged so they are all evenly spaced and sized
heres my janky code for it
local Workspace = game:GetService("Workspace")
local userInputService = game:GetService("UserInputService")
local character = script.Parent
local head = character:WaitForChild("Head")
local player = game.Players.LocalPlayer
local viewModel = player.PlayerGui:WaitForChild("viewModel").texture
viewModel.Parent.Enabled = false
--205x89
local function attributeChanged()
if character:WaitForChild("HumanoidRootPart"):GetAttribute("attack") then
for i=1, 5 do
local x = 205 * (i-1)
local y = 89
local newVec = Vector2.new(x, y)
viewModel.ImageRectOffset = newVec
task.wait(.1)
end
for i=5, 1,-1 do
local x = 205 * (i-1)
local y = 89
local newVec = Vector2.new(x, y)
viewModel.ImageRectOffset = newVec
task.wait(.1)
end
end
end
character:WaitForChild("HumanoidRootPart"):GetAttributeChangedSignal("attack"):Connect(attributeChanged)
local playerList = player.PlayerGui.playerList
local function firstPerson()
if head.LocalTransparencyModifier == 1 then
viewModel.Parent.Enabled = true
userInputService.MouseIconEnabled = false
playerList[player.UserId].ImageLabel.ImageTransparency = 1
-- player is in 1st person
else
viewModel.Parent.Enabled = false
userInputService.MouseIconEnabled = true
playerList[player.UserId].ImageLabel.ImageTransparency = 0
-- player is not in 1st person
end
end
head:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(firstPerson)
and this is the super simple code i use to 'bounce' the viewmodel around while you are moving
local Workspace = game:GetService("Workspace")
local character = script.Parent
local hum = character:WaitForChild("Humanoid")
local head = character:WaitForChild("Head")
local player = game.Players.LocalPlayer
local viewModel = player.PlayerGui:WaitForChild("viewModel").texture
local directions = {
[1] = {x = -1, y = -1},
[2] = {x = -1, y = 0},
[3] = {x = 1, y = 0},
[4] = {x = 1, y = 1}
}
local function looper()
local xScale, yScale
local multiplier = 10
local frame = 0
while true do
if head.LocalTransparencyModifier == 1 and hum.MoveDirection.Magnitude ~= 0 then
frame = frame + 1 <= 4 and frame + 1 or 1
xScale = (directions[frame].x * multiplier)/1000
yScale = (directions[frame].y * multiplier)/1000
viewModel.Position = UDim2.new(viewModel.Position.X.Scale + xScale, 0, viewModel.Position.Y.Scale + yScale, 0)
end
task.wait(0.1)
end
end
looper()
super spaghetti so i wouldn't recomend using it as an example for best practices or anything lol
oh im also noticing that i actually never reset it to the default sprite after attacking lol, whoops
thank you man
that's the best i could hope for
i'll take a look at it when i get home and update you
i cant publish the image lol
ts gonna be a long year
@dire carbon roblox giving me an error for the asset publishing, may i have your link ? for now i can't remake one myself
i think you just have to convert it back to png, discord converts images to webp
open and re-save it in paint