Inventory system help value

hi i want some help i am doing inventory system the inventory system have slot value it dont type with number it type with tool name i want do if player put sword in slot it add image frame for tool or viewport frame
this photo https://gyazo.com/34095e543f3b7953ddec34fae8b54a69
and thx

1 Like

If player get tools you have to FireServer with tool (that added) parameter.

local VPF = -- Locate to ViewportFrame

game.ReplicatedStorage.toolAdded.OnClientEvent:Connect(function(toolObj) -- Getting tool that player got

	local toolClone = toolObj:Clone() -- making clone of tool
	toolClone.Parent = VPF -- putting tool clone in the ViewportFrame
	
	local camera =  Instance.new("Camera") -- adding Camera
	camera.Parent = VPF 
	VPF.CurrentCamera = camera
	camera.CFrame = toolClone.CFrame * CFrame.new(0,0,toolClone.Size.z * 1.5)

end)

This is the example how to use VPF. You have to edit script for your game.

1 Like