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 gear to be able to consistently be used - not only work once -
What is the issue? Include screenshots / videos if possible!
The first time it’s shot, it works well. Each shot after it seems to not want to work / only works for a short amount of time. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Scoured the entire internet, asked assistant, seemingly no available fixes that have been posted
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!
Serverscript:
local MousePos = game.ReplicatedStorage:WaitForChild("MousePos")
local UIS = game:GetService("UserInputService")
local TTS = game.ReplicatedStorage:WaitForChild("TalkTuahServer")
local TTCS = game.ReplicatedStorage:WaitForChild("TalkTuahCServer")
local KeyUnpressed = game.ReplicatedStorage:WaitForChild("KeyUnpressed")
local ActiveODM = false
TTS.OnServerEvent:Connect(function(Player)
local Character = Player.Character
local Torso = Character:WaitForChild("Torso")
local ODMS = Instance.new("Sound", Torso)
ODMS.SoundId = "rbxassetid://111363457469205"
local AttachmentTorso = workspace.Part:WaitForChild("Attachment")
local AttachmentTorsoPos = AttachmentTorso.Position
local root = Character:WaitForChild("HumanoidRootPart")
local mousePosition = MousePos:InvokeClient(Player)
local ODMDirection = (mousePosition - AttachmentTorsoPos)
local raycastResult = workspace:Raycast(AttachmentTorsoPos, ODMDirection)
local facing = CFrame.lookAt(root.Position, mousePosition)
local moveSpeed = 100
local Travelling = false
if raycastResult then
local Distance = ODMDirection.Magnitude
if Distance <= 500 and ActiveODM == false then
ActiveODM = true
ODMS:Play()
print(Distance)
print(Distance / 150)
task.wait(Distance / 500)
local Velocity = Instance.new("BodyVelocity", root)
Velocity.MaxForce = Vector3.new(999999,999999,999999)
Velocity.P = 5000000
Velocity.Velocity = (-facing.ZVector * moveSpeed)
print(Distance / moveSpeed)
task.wait(Distance / moveSpeed)
Velocity:Destroy()
ODMS:Stop()
ActiveODM = false
print("Destroyed!")
else
warn("Denied")
end
end
end)
TTCS.OnServerEvent:Connect(function(Player)
local Character = Player.Character
local Torso = Character:WaitForChild("Torso")
for _, findATC in ipairs(Torso:GetChildren()) do
if findATC:IsA("Attachment") and findATC.Name == "ATC1" then
print("Success")
findATC:Destroy()
end
end
end)
KeyUnpressed.OnServerEvent:Connect(function(Player)
print("received keyunpressed")
local Character = Player.Character
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Velocity = HumanoidRootPart:WaitForChild("BodyVelocity")
Velocity:Destroy()
end)
Localscript
local UIS = game:GetService("UserInputService")
local TalkTuahServer = game.ReplicatedStorage:WaitForChild("TalkTuahServer")
local TalkTuahCServer = game.ReplicatedStorage:WaitForChild("TalkTuahCServer")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local KeyUnpressed = game.ReplicatedStorage:WaitForChild("KeyUnpressed")
UIS.InputEnded:Connect(function(InputEnded)
if InputEnded.KeyCode == Enum.KeyCode.E then
KeyUnpressed:FireServer()
end
end)
UIS.InputBegan:Connect(function(Input, GPE)
if Input.KeyCode == Enum.KeyCode.E and GPE == false then
print("e key is down")
TalkTuahServer:FireServer(Player, Player.Character)
end
end)
*Invoke (mouse location)
local MousePos = game.ReplicatedStorage:WaitForChild("MousePos")
MousePos.OnClientInvoke = function()
return game.Players.LocalPlayer:GetMouse().Hit.Position
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.