so i have a glider system that when you press the G key it deploys a glider, it works when doing it for the first time but after pressing the key again it wont give the glider, theres prob something wrong with the cloning bit cus i dont understand how cloning fully works.
so heres the scripts:
LOCAL SCRIPT STARTER CHARACTER SCRIPTS
local RS = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local SG = game:GetService("StarterGui")
local Event = RS.GuiderRemote
local Event2 = RS.GuiderRemote2
local Open = false
local Debounce = false
UIS.InputBegan:Connect(function(Key,IsTyping)
if IsTyping then return end
if Key.KeyCode == Enum.KeyCode.G and Open == false and Debounce == false then
Open = true
Debounce = true
Event:FireServer()
SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
wait(5)
Debounce = false
elseif Key.KeyCode == Enum.KeyCode.G and Open == true and Debounce == false then
Open = false
Debounce = true
Event2:FireServer()
SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
wait(5)
Debounce = false
end
end)
SERVER SCRIPT:
local RS = game:GetService("ReplicatedStorage")
local CS = game:GetService("CollectionService")
local Guider = RS.Glider["Wind Guider"]:Clone()
local Event = RS.GuiderRemote
local Event2 = RS.GuiderRemote2
Event.OnServerEvent:Connect(function(plr)
local Hum = plr.Character:FindFirstChildOfClass("Humanoid")
if Hum then
Guider.Parent = plr.Backpack
Hum:EquipTool(Guider)
end
end)
Event2.OnServerEvent:Connect(function(plr)
local Hum = plr.Character:FindFirstChildOfClass("Humanoid")
if Hum then
Hum:UnequipTools()
Guider:Destroy()
end
end)
really appreciate any help i can get, Thank you very much.