Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Client sided shop unwanted?

Hello guys i am trying to make 3D shop so it works now only problem is when items move to player's backpack they are client sided so only owner can see them. I need to fix that with remote function but i never used remote functions before . Here is what i made: local script

Pur.MouseButton1Down:connect(function()
	createPartEvent:FireServer(player, Purchase)
end)

server script (location = game.ServerScriptService)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = game.ReplicatedStorage:WaitForChild("GuiHandler")
local player = game.Players.LocalPlayer
local timed = 0

local function onCreatePartFired(Purchase)
	print("CONNECTED")
	wait(1)
	finished = workspace.ToolCams:FindFirstChild("Focus"..timed)
	local cash = player.leaderstats.KG
	char = player.Character
	local Tools = char:FindFirstChild("tool")
	if cash.Value >= finished.Cost.Value then
		    player.CurrentTool.tool:Destroy()
			local item = game.ReplicatedStorage.Tools:FindFirstChild(finished.Item.Value):Clone().Parent == player.Backpack
			item.Name = "tool"
	end
end

i think there is 2 problems actually 1st - they are not connecter because it didnt print 2nd - wrong argument in local script but i dont know how to fix that because output not showing me my errors so i dont know what i have to fix.

3 comments

0

Please use the LUA code block, others are confused of what you are trying to say.

0

idk how

0

done

1 answer

The player variable and the purchase variable don't seem to exist. You are getting the error because in

createPartEvent:FireServer(player, Purchase)

you haven't specified what the player is equal to, neither the purchase. Because of the error, the code breaks and therefore, the remote isn't fired.

This discussion is preserved as it was. New answers, comments, and votes are closed.