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

how do i fix things coming out of a shop gui?

Asked by 5 years ago

ok so i made a shop gui, and made it where if you click things, it gives you them yknow the basic but when it gives me the gun, it doesnt let me kill anyone, like it only kills them on my screen but they dont really die, but if i use :give me all then i can kill them - heres the script

script.Parent.MouseButton1Click:Connect(function()

local RS = game:GetService("ReplicatedStorage")

local item = RS:WaitForChild("GlockDrum")

local player = game.Players.LocalPlayer

local cloned = item:Clone()

cloned.Parent = player.Backpack

end)
0
Its not the shop gui its the gun. You need to make the gun filtering enabled. IcyBlazeRB 28 — 5y
0
^ Read what he said; he said when he uses a command to give himself the gun, it works. @OP You're cloning the gun on the client, which isn't replicated to the server; you'll need to use a remote to give a player the gun. TheeDeathCaster 2368 — 5y
0
how can i use a remote on the gun @TheeDeathCaster PappyXCuasi 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Hi, I'm quite the novice especially in roblox but I thought i could share my experience anyways. I'm going to try to be as clear as possible.

THE ISSUE

So my guess is that the shop doesn't run on a server script, what do I mean by that? When you purchase something wich i'm guessing you have written inside a localscript it will grant the player the tool. The issue is that the server does not know about this. Therefor you can't kill anybody cause they don't know the weapon exists.

SOLUTION

Its simple use remote events. They essentially send info from the client to the server, in this case you can make a remote event that grants the player the tool this will make sure that the servers knows about it and can replicate it. This also means the weapon should be able to kill other people. The reason :get all works is because the "admin system" runs in a serverscript therefor it replicates to all players. I hope this was to some help.

-Paragonixy

0
how would i use a remote event on it though? examples PappyXCuasi 0 — 5y
Ad

Answer this question