-
What do you want to achieve? Keep it simple and clear!
I want to fix the problem with my script. -
What is the issue? Include screenshots / videos if possible!
The issue is that I don’t know how to fix it because it is happening for the first time to me. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried but I couldn’t find any solutions.
Script: (Local Script)
--// Services
local Lightning = game:GetService("Lighting")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
--// Player
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChild("Humanoid")
--// Tool
local Tool = script.Parent
--// Folders
local ModulesFolder = ReplicatedStorage.ATPS.Modules
local AnimationsFolder = ReplicatedStorage.ATPS.ToolAnim
local RemoteEventsFolder = ReplicatedStorage.ATPS.RemoteEvents
--// Remote Events
local ATPSCredit = RemoteEventsFolder["ATPS | Credit"]
--// Modules
local GlobalConfig = require(ReplicatedStorage.ATPS.GlobalConfig.Config)
local Camera = require(ReplicatedStorage.ATPS.Modules.Camera)
--// Variables
local CanFire = true
local CanAim = false
local ChangeShoulderDB = false
--// Equip
Character.ChildAdded:Connect(function(Obj)
if Obj == Tool then
Camera:Enable()
Camera:SetCharacterAlignment(true)
end
end)
--// UnEquip
Character.ChildRemoved:Connect(function(Obj)
if Obj == Tool then
Camera:SetCharacterAlignment(false)
Camera:Disable()
end
end)
UserInputService.InputBegan:Connect(function(input, gameProccessed)
if input.KeyCode == Enum.KeyCode.T and Character:FindFirstChild(Tool) then
if ChangeShoulderDB == false then
Camera:SetShoulderDirection(-1)
ChangeShoulderDB = true
elseif ChangeShoulderDB == true then
Camera:SetShoulderDirection(1)
ChangeShoulderDB = false
end
end
end)
Character.ChildRemoved:Connect(function(Obj)
if Obj:IsA("LocalScript") and Obj.Name == "Client" then
Player:Kick("Client detected suspicious changes.")
elseif Obj:IsA("LocalScript") and Obj.Name == "AntiExploit" then
Player:Kick("Client detected suspicious changes.")
end
end)