Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I had help for the guns, but it keeps giving me them if i press twice, three times etc?

Asked by 4 years ago
Edited 4 years ago

how do i stop that?

i have in serverscriptservice 2 scripts, not local, this code

if game.Players.LocalPlayer.Backpack:FindFirstChild("pistol") then return end

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function(player) local tool = game.ReplicatedStorage.Pistol tool:Clone().Parent = player.Backpack end )

THE PISTOL IS CHANGED TO TrenchGun in the second one

1 answer

Log in to vote
0
Answered by
Pupppy44 671 Moderation Voter
4 years ago

Assuming this is a local script

if game.Players.LocalPlayer.Backpack:FindFirstChild("gunname") then
return
end

Although I don't suggest using a local script to check this, as exploiters can bypass it.

0
where do i put iy ScottRulesAtAnything -1 — 4y
0
Looking at your question from before, put that before firing the remote event. Pupppy44 671 — 4y
0
i'll try it ScottRulesAtAnything -1 — 4y
0
it didnt work ScottRulesAtAnything -1 — 4y
View all comments (3 more)
0
i put them in the serverscriptservice scripts, is that right ScottRulesAtAnything -1 — 4y
0
Put that in the local script, you can't get the localplayer in a normal script... Pupppy44 671 — 4y
0
it still gives me all of the weapons ScottRulesAtAnything -1 — 4y
Ad

Answer this question