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!
To make the remote event fire and give the player the tool
What is the issue? Include screenshots / videos if possible!
it doesnt give the player the tool
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
havent found any
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!
Well i dont see any typos heck i checked the folder there is no tool typo
--Server Script in ServerScriptService
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
remote.OnServerEvent:Connect(function(plr, Message, WindSword)
if Message == "Giver Gear" then
items[WindSword]:Clone().Parent = plr.Backpack
--We do the same thing but we change the tool
remote.OnServerEvent:Connect(function(plr, Message, Insert)
if Message == "Giver Gear" then
items[Insert]:Clone().Parent = plr.Backpack
end
end)
end
end)
--- Gui Local Script
script.Parent.MouseButton1Click:Connect(function()
local remote = game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
remote:FireServer("WindSword")
end)
-- The 2nd Gui Local Script
script.Parent.MouseButton1Click:Connect(function()
local remote = game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
remote:FireServer("Insert")
end)
@NateOTB its multiplying every time i click it i want it to give me one everytime i click but it gives 2,3,4,5 ect the more i click it the more it multiplies
maybe adding a debounce?
create a table insert the player after you gave the tool to the player .
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, WindSword)
if Message == "Giver Gear" and not table.find(Table, plr ) then
items[WindSword]:Clone().Parent = plr.Backpack
table.insert(Table , plr)
@NateOTB i use the same deounce method on a different script and if i click on the gui button
it gives me one tool but if i click the other gui button with the same debounce method it doesnt give me the tool?
@NateOTB it works welll sort of when i changed the other script to the debounce method i could click one of the gui button it would appear in my backpack but if i click the button gui again it doesnt do anything any fix to this?