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

When I clone a part with a script from ReplicatedStorage to Workspace, the script doesn't work?

I am creating a roleplay game that can be controlled by the host. The hosts can spawn things like chests and notes with a gui button. I'm currently creating the first one which is just a simple click part to open gui. But when I clone it from replicated storage to workspace, the gui text wont appear. The part that can be clicked is placed into workspace, but when I click it, the GUI text doesn't appear. Why is that?

Note part script: note = script.ChestNote:Clone() script.Parent.ClickDetector.MouseButton1Click:Connect(function(player) note.Parent = player.PlayerGui end)

local rep = game.ReplicatedStorage local function event() rep.Open:FireServer() end

script.Parent.MouseButton1Click:Connect(event)

Button that summons the note part: local rep = game.ReplicatedStorage local function event() rep.Open:FireServer() end

script.Parent.MouseButton1Click:Connect(event)

SCRIPT IN SERVERSCRIPTSERVICE: rep = game.ReplicatedStorage function note() rep.Note.Parent = game.Workspace

end

rep.Open.OnServerEvent:Connect(note)

3 comments

0

Please use a code block to put the scripts in, that will make it much easier to read.

0

i already placed a code block in the script but the note gui still doesn't appear when i click the part

0

nvm i already fixed it

1 answer

FIXED the clickdetector doesn't have a MouseButton1Click (its only for gui buttons). i just changed it into MouseClick

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