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

Client Sided Shop Bug?

Asked by 5 years ago

Hello guys i am working on simulator game so i decided to create 3D shop gui . After it was done i didnt see any bugs but when i asked my friend help me test it and he buy then wear weapon his weapon was invisible for me i thinked its a bug untill he told me my weapon is invisible too. I dont understand client siding so can someone help me with it? Here is the script(there is other scripts too so if it didnt comming from that script please tell me to post other) : wait() local TweenService = game:GetService("TweenService") local finish = workspace.ToolCams.Focus1.CFrame camera = workspace.CurrentCamera local timed = 0 local player = game.Players.LocalPlayer local char = nil finished = nil local Back = script.Parent.ScreenGui.Backward local For = script.Parent.ScreenGui.Forward local close = script.Parent.ScreenGui.Close local itemN = script.Parent.ScreenGui.ItemName local itemC = script.Parent.ScreenGui.ItemCost local Pur = script.Parent.ScreenGui.PurchaseButton local Debounce = false local tolv = false local tooly = nil repeat wait() until player.Character ~= nil --script.Parent.StatsGui.LocalScript.Disabled = false

local function movie() finished = workspace.ToolCams:FindFirstChild("Focus1") timed = 1 itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value camera.CFrame = workspace.CameraPart.CFrame camera.CameraSubject = workspace.CameraPart game:GetService("RunService").RenderStepped:Wait() end

local function search() local char = player.Character for i,v in pairs (char:GetChildren()) do if v:IsA("Tool") then tolv = 1 tooly = v else tolv = 0 tooly = v end end end

local function bum() local back = player.Backpack for i,v in pairs (back:GetChildren()) do if v:IsA("Tool") then v:Destroy() end end end

local function act() for i,v in pairs (player.Backpack:GetChildren()) do if v==nil then tolv = false else tolv = true end end end

Pur.MouseButton1Down:connect(function() 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() item.Parent = player.Backpack item.Name = "tool" end end)

local function start() char = player.Character if Debounce == false then camera.CameraType = "Scriptable" Back.Visible = true For.Visible = true itemC.Visible = true itemN.Visible = true Pur.Visible = true close.Visible = true Debounce = true for i,v in pairs(script.Parent.ScreenGui:GetChildren()) do if v.Name == "BG" then v.Visible = true end end movie() end end

For.MouseButton1Down:connect(function() timed = timed + 1 if timed == 4 then timed = 1 end local cameray = workspace.CameraPart finished = workspace.ToolCams:FindFirstChild("Focus"..timed) itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value workspace.CameraPart.PosTime.Value = timed local Tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false) local Goal = {CFrame = CFrame.new(finished.Position)} local tween = TweenService:Create(camera,Tweeninfo,Goal) tween:Play() print(timed) end)

Back.MouseButton1Down:connect(function() timed = timed - 1 if timed == 0 then timed = 3 end local cameray = workspace.CameraPart finished = workspace.ToolCams:FindFirstChild("Focus"..timed) itemN.Text = finished.Item.Value itemC.Text = "$"..finished.Cost.Value workspace.CameraPart.PosTime.Value = timed local Tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false) local Goal = {CFrame = CFrame.new(finished.Position)} local tween = TweenService:Create(camera,Tweeninfo,Goal) tween:Play() print(timed) end)

close.MouseButton1Down:connect(function() wait() Back.Visible = false For.Visible = false itemC.Visible = false itemN.Visible = false Pur.Visible = false close.Visible = false for i,v in pairs(script.Parent.ScreenGui:GetChildren()) do if v.Name == "BG" then v.Visible = false end end camera:Destroy() wait(0.1) camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Custom game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid local char = player.Character local hum = char.HumanoidRootPart hum.CFrame = workspace.Respawn1.CFrame * CFrame.new(0,3,0) local v = player.CurrentTool.tool.Namey.Value player.CurrentTool.tool.Name = player.CurrentTool.tool.Namey.Value player.CurrentTool[v].Parent = player.Backpack Debounce = false end) local function Get() local y = nil local char = player.Character local back = player.Backpack for i,v in pairs (char:GetChildren()) do if v:IsA("Tool") then v.Parent = player.CurrentTool v.Name = "tool" end end if y == nil then for i,v in pairs (back:GetChildren()) do if v then v.Parent = player.CurrentTool v.Name = "tool" end end end end repeat wait() until player.Character.UpperTorso~=nil

while true do
    local Debounce = true
    local center = workspace.Center2
    local tool = game.Workspace.ToolTrigger
    if player.Character ~= nil then
    local char = player.Character
        local mag = (center.Position - char.UpperTorso.Position).magnitude
        if mag <= 6  then
            Get()
            Debounce = false
            start()
            Debounce = true

    end
end

wait() end Please help me ! i never used client sided and i dont know how to add/remove it D:

0
sorry script dont posted on right way i never used this site before theswagboy0813 -14 — 5y
0
rap your code in codeblocks which are "~" so we can read your script :D mixgingengerina10 223 — 5y

Answer this question