What do you want to achieve?
When an admin press the button he gains an gear.
What is the issue?
What solutions have you tried so far?
I tried looking at devhub and tutorials.
local player = game:GetService("Players")
local minigun = game.ServerStorage:WaitForChild("Minigun")
local sound = script.Parent.Parent.Parent.Parent.UIClick
script.Parent.MouseButton1Click:Connect(function()
sound:Play()
if player.Name == "GuipaGG1" or "istoleyourlunchmeat" then
local newmini = minigun:Clone()
newmini.Parent = player.Backpack
else
return
end
end)
Try placing your minigun under game.ReplicatedStorage instead. Seems like you are using a Local Script.
After you put your minigun from game.ServerStorage to game.ReplicatedStorage, change your code to:
local player = game:GetService("Players").LocalPlayer
local minigun = game.ReplicatedStorage:WaitForChild("Minigun")
local sound = script.Parent.Parent.Parent.Parent.UIClick
script.Parent.MouseButton1Click:Connect(function()
sound:Play()
if player.Name == "GuipaGG1" or "istoleyourlunchmeat" then
local newmini = minigun:Clone()
newmini.Parent = player.Backpack
else
return
end
end)
local player = game:GetService("Players").LocalPlayer
local minigun = game.ReplicatedStorage:WaitForChild("Minigun")
local sound = script.Parent.Parent.Parent.Parent.UIClick
script.Parent.MouseButton1Click:Connect(function()
sound:Play()
if player.Name == "GuipaGG1" or "istoleyourlunchmeat" then
local newmini = minigun:Clone()
newmini.Parent = player.Backpack
else
return
end
end)
local player = game:GetService("Players").LocalPlayer
local minigun = game.ReplicatedStorage:WaitForChild("Minigun")
local sound = script.Parent.Parent.Parent.Parent.UIClick
local debounce = false
script.Parent.MouseButton1Click:Connect(function()
sound:Play()
if player.Name == "GuipaGG1" or "istoleyourlunchmeat" and debounce == false then
local newmini = minigun:Clone()
newmini.Parent = player.Backpack
warn("Admin has got minigun")
debounce = true
wait(4)
debounce = false
else
return
end
end)
Okay I see, but just as a reference, the code you used was from my reply:
It’s not a problem that you gave the solution to @CoasterOof , but next time try to give props to the one that took the time to help you get the problem solved and working !