So I have two remote events in the replicated storage start1 and finish1. I have a local script in the starter pack which has a script inside of it.
Scripts:
Local:
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local toggle = false
local remoteEvent = game.ReplicatedStorage:WaitForChild("Start1")
local remoteEvent2 = game.ReplicatedStorage:WaitForChild("Finish1")
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and toggle == false then
remoteEvent:FireServer()
toggle = true
end
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and toggle == true then
remoteEvent2:FireServer()
toggle = false
end
end)
ServerScript inside the local script:
Debounce = false
Aura1 = game.ReplicatedStorage:WaitForChild("SixPaths1")
Aura2 = game.ReplicatedStorage:WaitForChild("SixPaths2")
game.ReplicatedStorage.Start1.OnServerEvent:Connect(function(player)
for i = 1,1 do
for i, v in pairs(player.Character:GetChildren()) do
Aura1Clone = Aura1:Clone()
Aura2Clone = Aura2:Clone()
Aura1Clone.Parent = v
Aura2Clone.Parent = v
end
end
Pants = player.Character.Pants
Shirt = player.Character.Shirt
Shirt.Parent = game.ReplicatedStorage
Pants.Parent = game.ReplicatedStorage
for i, v in pairs(player.Character:GetChildren()) do
if v:IsA("BasePart") then
v.Material = Enum.Material.Neon
v.Color = Color3.fromRGB(170,85,0)
end
end
player.Character.Head.Color = Color3.fromRGB(218,133,65)
player.Character.Humanoid.WalkSpeed = player.Character.Humanoid.WalkSpeed*2
player.Character.Humanoid.MaxHealth = 150
game.ReplicatedStorage.Handle.Color = Color3.fromRGB(255,89,89)
game.ReplicatedStorage.RasenExplosion.Color = Color3.fromRGB(255,89,89)
end)
game.ReplicatedStorage.Finish1.OnServerEvent:Connect(function(player)
Aura1Clone:Destroy()
Aura2Clone:Destroy()
end)
My problem is that when I press q again it doesn't run the second function like it is supposed to. Do you guys know how to fix this?
