good evening, how do i add scripts to instant.new() parts?
my current idea: maybe i could do
instance.new('part', workspace)
if game.workspace.name == new.part then (script)
but thats not working.
Additional Information:
game is about clicking generated parts for points against other players. you would be able to buy 1 time use items (such as swords to delay others)
these are my scripts:
press play button (only works if server is new)
local TextButton = script.Parent
local Player = game.Players.LocalPlayer
TextButton.MouseButton1Click:Connect(function()
script.Parent.Visible = false
Player.PlayerGui.ScreenGui.Frame.TextLabel.LocalScript.Disabled = false
Player.PlayerGui.ScreenGui.Frame.TextLabel.Visible = true
Player.PlayerGui.ScreenGui.Frame.new.Visible = false
end)
part spawners:
function brick(
)
wait(1)
script.Parent.Text = 'loading... 1 '
wait(1)
script.Parent.Text = 'loading... 2 '
wait(1)
script.Parent.Text = 'loading... 3 '
script.Parent.Text = 'error loading '
local Part = Instance.new("Part")
Part.Parent = game.Workspace
Part.Name = "click"
Part.BrickColor = BrickColor.Random()
Part.Material = "Metal"
local Poss = math.random(-500,500)
Part.Position = Vector3.new(Poss)
local pos = Part.Position
script.Parent.Text = tostring(Part.Position)
end
brick()
note: all scripts are local; it would be ideal if a plus 1 point for every time you pressed instance.new() brick and leaderstat showing top player global and server script was included.
thank you