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

Why wont the scripts work in my item from ReplicatedStorage?

Asked by
N33H 19
5 years ago
-- Variables -- 

repeat wait() until game.Players.LocalPlayer.Character

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Rp = game.ReplicatedStorage
local Printer = Rp.Printers.Printer

-- Scripting --

script.Parent.MouseButton1Down:Connect(function()
    if script.Parent.Text == "Buy Printer!" then
        local ClonedPrinter = Printer:Clone()
        ClonedPrinter.Parent = workspace
        ClonedPrinter.PrimaryPart = ClonedPrinter.Main
        ClonedPrinter:SetPrimaryPartCFrame(Character.Head.CFrame)
    end
end)

This is a script inside a GUI button, when you click it gets the item from the ReplicatedStorage and spawns it in front of you, I try using the Model without spawning and it just being in the Workspace and all the scripts work fine, but as soon as I use this for spawning, none of the scripts work. Does anyone know why?

0
try if script.Parent.Text.Value == "Buy Printer!" then aandmprogameing 52 — 5y
0
Text doesn't have a value LOL. N33H 19 — 5y

Answer this question