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

Issue Implementing Tuneable's Placement Script?

Asked by 6 years ago
Edited 6 years ago

Hello, recently I ran into a small problem when I tried to add Tunicus's placement script into my personal place. Loading up the game, the output returns ...PlayerGui.PlacementGui.PlacementScipt:45: attempt to index local 'signal' (a nil value), which I presume is an issue with the way that the "signal" variable is being created or interacted with.

Here is the copy of the localScript, which handles the client-sided placement of objects:

--Backbone of script made by Tuneable Studios/Tunicus
local placementHandler = require(script:WaitForChild("PlacementModule"))
local localPlayer = game.Players.LocalPlayer
local baseplate = game.Workspace.PlayerPlates:WaitForChild(localPlayer.Name)
local itemHold = game.Workspace.ItemHolder
local items = game:GetService("ReplicatedStorage").Items

local plane = placementHandler.new(baseplate, itemHold, 1)
local currentItem
local signal

local function cancelPlacement()
    if (currentItem) then
        plane:disable()

        if(fakeModel.Parent) then
            fakeModel:Destroy()
        end

        fakeModel = nil
        signal = nil
        currentItem = nil   
    end
end


local function beginPlacement(itemName)
  cancelPlacement()

  fakeModel = items[itemName]:clone()
  currentItem = itemName

  for _, object in pairs(fakeModel:GetChildren()) do
            if(object:IsA("BasePart")) then
            object.CanCollide = false
        end
    end

  fakeModel.Parent = workspace

  plane:enable(fakeModel)

  local signal = plane:enable(fakeModel)

  signal:connect(function(location,_)
    game:GetService("ReplicatedStorage").ClientSidedPlacement:FireServer(currentItem, location[1])

    cancelPlacement()
    end)    
end

wait(3)

beginPlacement("Model")

And here is a copy of Tuneable's placement script: *Due to the 10k character limit, I will link the script instead. It can be found at https://www.roblox.com/library/1122124371/Placement-Handler-V2

My guess is that there is an issue when setting local "signal" to plane:enable(fakeModel) as it appears to have changed in the newer version of the ModuleScript. How can I remedy this? Thanks in advance.

0
Did you every get it working, i have the same problem KamikazeJAM108867 38 — 5y

Answer this question