#Does anyone know why my code isn't working

1 messages · Page 1 of 1 (latest)

last inlet
#

local button = workspace.button

button.ClickDetector.MouseClick:Connect(onClick)
function onClick()
Instance.new("Part")
Part.Parent = game.Workspace
Part.Position = Vector3.new(-1.8, 2.7, 61.2)
Part.Size = Vector3.new(1, 1, 1)
Part.Material = "Neon"
Part.BrickColor = "Really red"
end

it is a local script in serverscriptservice

weak obsidian
#

LOL

#

IM GIGGLING SO HARD RN

#

@last inlet

#

ur trolling right

warped hull
#

oh my god bruh

weak obsidian
#

"local script in serverscriptsevice"

last inlet
weak obsidian
#

are we dead ass

#

then we fucking make a global function

#

LMAO

last inlet
#

ok

weak obsidian
#

theres so much stuff

#

wrong w this

last inlet
#

k

warped hull
#

for a start

last inlet
warped hull
weak obsidian
#

its so clear that u dont know what ur doing

#

"game.Workspace"

#

"workspace" exists buddy

warped hull
#

damn

#

ive been using game.Workspace for everything

#

thanks my dude

weak obsidian
#

everything wrong

#

with this

#
  1. first off, why are you putting a local script in serverscriptservice???
  2. secondly, the function onclick is supposed to go before the connection
  3. thirdly, u should make the function a local function, not global.
  4. ur using instance.new but do not define it as a variable
  5. ur using game.Workspace when workspace exists
  6. u define a material using Enum.Material
  7. u define brick color using BrickColor.new
#

@last inlet

last inlet
#

how do i make it a local function

#

@weak obsidian

warped hull
#

like your variable

last inlet
warped hull
last inlet
#

k

#

for the instance do i do local Part = instance.new("Part") and Part.parent = game.Workspace?

warped hull
#

then just modify it as you were

#

capital I for instance

last inlet
#

k

last inlet
warped hull
#

what isnt

last inlet
#

like it isnt spawning the part

#

@warped hull

warped hull
#

local button = script.Parent

local function spawn()
local Part = Instance.new("Part")
Part.Parent = game.Workspace
Part.Position = button.Position + Vector3.new(0, 3, 0)
Part.Anchored = false
Part.Size = Vector3.new(1, 1, 1)
Part.Material = Enum.Material.Neon
Part.BrickColor = BrickColor.new("Really red")
end
button.ClickDetector.MouseClick:Connect(spawn)

#

assuming your script is in the part

last inlet
#

no my script is in serv script service should i put it in the part

warped hull
#

if its in serverscriptservice you can just use
local button = game.Workspace.button

last inlet
#

yay you did it!!

#

tysm

#

🙂

gusty anvil
#

aka read it

gusty anvil
#

youre an actual incel for saying all that

weak obsidian
#

shut the fuck up

thorny swallow
wraith lichenBOT
#

studio** You are now Level 1! **studio

weak obsidian
thorny swallow
#

u are douche i am not

weak obsidian
#

scumbag

thorny swallow
#

bro..

weak obsidian
#

ur a larper

thorny swallow
#

dont say that

weak obsidian
#

ur a skid

thorny swallow
#

SKID

#

TOO FAR

weak obsidian
#

ur an alt

thorny swallow
#

do not look at my youtube vid

weak obsidian
#

i wont

thorny swallow
#

no.. i am not

#

this is my real acount

#

and i am way better script than u

#

pink eye fart face

#

pink eye, fart face, tripped over your shoelace

#

better brace for this face off

#

im wesley and im tuff

#

i will make you look ruff

#

im super buff

#

and tuff

#

i called ur bluff

#

one little breeze and u go puff

#

your insults are rough

#

so stop them

#

now

#

powerpuff girl

strong roost
#

bro spitting bars 🔥🔥🔥

gusty anvil
#

since when was wasting my time online used as an insult

#

actual fucking idiot