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 want the revolver to be rotated correctly.
What is the issue? Include enough details if possible!
When moving, the revolver will be randomly rotated.
What solutions have you thought of so far?
none
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!
my code:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, MousePos)
local Character = player.Character
local Humanoid = Character.Humanoid
Humanoid.WalkSpeed = 8
local Revolver = game.ReplicatedStorage.Revolver:Clone()
Revolver.Name = “Handle”
Revolver.Parent = Character
local Weld = Instance.new(“Weld”, Character[“Right Arm”])
Weld.Name = “AccessoryWeld”
Weld.Name = “RightGripAttachment”
Weld.Part0 = Revolver
Weld.Part1 = Character.RightHand
Revolver.Rotation = Vector3.new(90,180,0)
local Animation = Instance.new(“Animation”, Humanoid)
Animation.AnimationId = “rbxassetid://11286633614”
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
local Bullet = Instance.new(“Part”, workspace)
local PlayerName = Instance.new(“StringValue”, Bullet)
PlayerName.Name = “PlayerName”
PlayerName.Value = player.Name
Bullet.CFrame = Character.HumanoidRootPart.CFrame
Bullet.TopSurface = Enum.SurfaceType.Smooth
local BVelocity = Instance.new(“BodyVelocity”, Bullet)
BVelocity.P = 750
BVelocity.Velocity = MousePos.LookVector * 100
BVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
Bullet.CanCollide = false
Bullet.Size = Vector3.new(0.5,0.5,0.5)
Bullet.Touched:Connect(function(touched)
local Hum = touched.Parent:FindFirstChild(“Humanoid”)
if Hum and not touched.Parent:FindFirstChild(“DamageScript”) then
if touched.Parent.Name ~= Bullet:FindFirstChild(“PlayerName”).Value then
local NewScript = Instance.new(“Script”, touched.Parent)
NewScript.Name = “DamageScript”
Hum:TakeDamage(25)
wait(0.4)
NewScript:Destroy()
else
local e
end
end
end)
end)
sorry for it being long
FIXED: My solution was messing around with CFrame.Angles.
system
(system)
Closed
November 23, 2022, 8:37pm
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.