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!
For it to clone it in the players tool
-
What is the issue? Include screenshots / videos if possible!
I click the gui button it puts the tool in the backpack but if i click it again it doesnt work
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i havent found any or related to this promblem
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!
Welll its a bit hard for to explain i used a table method for it to not multiply everytime i click it which worked but i did the same table method on the other weapon giver script
--First Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
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
items[WindSword]:Clone().Parent = plr.StarterGear
table.insert(Table, plr)
end
end)
--Second Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, ZygrainbowPeriastron)
if Message == "Giver Gear" and not table.find(Table, plr ) then
items[ZygrainbowPeriastron]:Clone().Parent = plr.Backpack
items[ZygrainbowPeriastron]:Clone().Parent = plr.StarterGear
table.insert(Table, plr)
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
i think i explained it well i think idk
Because of this? when you did it you added
table.insert(Table,plr)
so the plr is in the table and it wont run again
so what do i do? im new to all this stuff
can u take it the plr out of the table then loop it again and again @ItzBloxyDev
Sorry for the late reply but if you want to be able to get the tool multiple times change the script to this:
--First Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, WindSword)
if Message == "Giver Gear" then
items[WindSword]:Clone().Parent = plr.Backpack
items[WindSword]:Clone().Parent = plr.StarterGear
end
end)
--Second Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, ZygrainbowPeriastron)
if Message == "Giver Gear" then
items[ZygrainbowPeriastron]:Clone().Parent = plr.Backpack
items[ZygrainbowPeriastron]:Clone().Parent = plr.StarterGear
end
end)
its ok man i saw you working in roblox studio
without the table the more i click it the more it multiplies like if i click one time it gives me one but if i click it again it gives me 2 and ect
and i want to get it 1 time everytime i click it
not for it to multiply you understand me do you see what i mean? @ItzBloxyDev
sorry for the late reply(again)
Do you mean 2 by the old one plus the new one or when you click the button you get an extra 2?
Can you show me the local script?
when i click the button without the table method i get one weapon but if i click the gui button again i get 2 of the same weapon then 3 then 4 ect
the gui scripts? sure hold on give me one sec
script.Parent.MouseButton1Click:Connect(function()
local remote = game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
remote:FireServer("Giver Gear","ZygrainbowPeriastron")
end)
script.Parent.MouseButton1Click:Connect(function()
local remote = game:GetService("ReplicatedStorage"):WaitForChild("GiveGear")
remote:FireServer("Giver Gear","WindSword")
end)
those are the local script the server scripts were the one i first showed you
When I tested it I just got 2 every time I clicked because its firing for both.
hold on let me check somethin to see this wont take long
Does this work?
--First Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, WindSword)
if Message == "Giver Gear" and WindSword == "WindSword" then
items[WindSword]:Clone().Parent = plr.Backpack
items[WindSword]:Clone().Parent = plr.StarterGear
end
end)
--Second Script
local repRemote = game:GetService("ReplicatedStorage")
local repStorage = game:GetService("ServerStorage")
local items = repStorage.Items
local remote = repRemote.GiveGear
local Table = {}
remote.OnServerEvent:Connect(function(plr, Message, ZygrainbowPeriastron)
if Message == "Giver Gear" and ZygrainbowPeriastron == "ZygrainbowPeriastron" then
items[ZygrainbowPeriastron]:Clone().Parent = plr.Backpack
items[ZygrainbowPeriastron]:Clone().Parent = plr.StarterGear
end
end)
yes it does but ima show you the issue real quick