Tried to make a script so u can have mulitple forms in a game , However it can only activate form 3 i tried solving it and read trought the script cant find the issue can someone help?

LocalScript

wait(1)---- Services ----
local RepStorage = game:GetService("ReplicatedStorage")
local UserInputServer = game:GetService("UserInputService")

local Remote = RepStorage.KGRemoteEvents:WaitForChild("SharinganForm1")
local Remote2 = RepStorage.KGRemoteEvents:WaitForChild("SharinganForm2")
local Remote3 = RepStorage.KGRemoteEvents:WaitForChild("SharinganForm3")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local humanoid = Character:WaitForChild("Humanoid")
-- Settings --
local Cooldown = true
local Key = "C"
local Key2 = "One"
local Key3 = "Two"
local Key4 = "Four"
-- UI --
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local SFX = RepStorage.SFX
local SFX = RepStorage.SFX
local HoldingZ = false

-- UserINPUT
UserInputServer.InputBegan:Connect(function(Input,IsTyping)
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if KeyPressed == Enum.KeyCode[Key] then
		HoldingZ = true
		print("Holding Z")
	end 
end)
UserInputServer.InputEnded:Connect(function(Input,IsTyping)
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if KeyPressed == Enum.KeyCode[Key] then
		HoldingZ = false
		print("Not Holding Z")
	end 
end)

-- Firing Seprate Remotes
UserInputServer.InputBegan:Connect(function(Input,IsTyping)
		if IsTyping then return end
		local KeyPressed = Input.KeyCode
	    if HoldingZ and Enum.KeyCode[Key2] and Cooldown and Character then
		Cooldown = false
		Remote:FireServer()
		SFX.SharinganActivated:Play()
		wait(5)
		Cooldown = true
		print("Cooldown Over")	
	end
end)


UserInputServer.InputBegan:Connect(function(Input,IsTyping)
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if HoldingZ and Enum.KeyCode[Key3] and Cooldown and Character then
		Cooldown = false
		Remote2:FireServer()
		SFX.SharinganActivated:Play()
		wait(5)
		Cooldown = true
		print("Cooldown Over")	
	end
end)

UserInputServer.InputBegan:Connect(function(Input,IsTyping)
	if IsTyping then return end
	local KeyPressed = Input.KeyCode
	if HoldingZ and Enum.KeyCode[Key4] and Cooldown and Character then
		Cooldown = false
		Remote3:FireServer()
		SFX.SharinganActivated:Play()
		wait(5)
		Cooldown = true
		print("Cooldown Over")	
	end
end)

ServerSide

local RepStorage = game:GetService("ReplicatedStorage")
local KGFolder = RepStorage:WaitForChild("KGRemoteEvents")
local ActivateRemote = KGFolder:WaitForChild("SharinganForm1")
local ActivateRemote2 = KGFolder:WaitForChild("SharinganForm2")
local ActivateRemote3 = KGFolder:WaitForChild("SharinganForm3")



local function ActivateSharingan(plr)
	plr.Character.Head.GenkaiDisplay.ImageLabel.Image = "rbxassetid://5832656217"
		plr.KGStore.ActivatedForm.Value = 1
	print("Form 1")	
end

local function ActivateSharingan2(plr)
	plr.Character.Head.GenkaiDisplay.ImageLabel.Image = "rbxassetid://5832738151"
	plr.KGStore.ActivatedForm.Value = 2
	print("Form 2")
end

local function ActivateSharingan3(plr)
	plr.Character.Head.GenkaiDisplay.ImageLabel.Image = "rbxassetid://5836696117"
	plr.KGStore.ActivatedForm.Value = 3
	print("From 3")
end


ActivateRemote.OnServerEvent:Connect(ActivateSharingan)
ActivateRemote2.OnServerEvent:Connect(ActivateSharingan2)
ActivateRemote3.OnServerEvent:Connect(ActivateSharingan3)

5 comments

0

do you mean line 3?

0

^ Please explain the error a bit more

0

Well there are 3 forms of the sharingan IT only activates the 3 one

0

They are all working for me, albeit I made a shoddy replica of your system. Could you tell me if you have any errors?

0

Can i have you're discord so i can explian more detaildly