#Mousebuttonclick1 is nil
169 messages · Page 1 of 1 (latest)
script.Parent.MouseButton1Click:Connect(function(t)
print(t)
if script.Parent.Parent.Ordering.Text == "milk" or "Milk" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("milk")
script.Parent.Parent.Enabled = false
elseif script.Parent.Parent.Ordering.Text == "coffee" or "Coffee" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("coffee")
script.Parent.Parent.Enabled = false
elseif script.Parent.Parent.Ordering.Text == "acid" or "Acid" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("acid")
script.Parent.Parent.Enabled = false
else
script.Error:Play()
script.Parent.Parent.Ordering.Text = ""
script.Parent.Text = "Error"
task.wait(1)
script.Parent.Text = "Order"
end
end)
Script
as you see
nothing shit is wrong
but when I type "Acid"
it's give you milk
wth
in fire server if you're wondering
game.ReplicatedStorage.SCP.SCP294.Cloning.OnServerEvent:Connect(function(plr, a)
local t = game.ServerStorage.Drinks[a]:Clone()
t.Parent = plr.Backpack
end)
no error btw
I got no clue
how it not work
yeah so weird
I check the script.Parent.Parent.Ordering.Text
it's say value is "acid"
but it's run on
if script.Parent.Parent.Ordering.Text == "milk" or "Milk" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("milk")
script.Parent.Parent.Enabled = false
sure sure
script.Parent.MouseButton1Click:Connect(function(t)
print(t)
if script.Parent.Parent.Ordering.Text == "milk" or "Milk" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("milk")
script.Parent.Parent.Enabled = false
elseif script.Parent.Parent.Ordering.Text == "coffee" or "Coffee" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("coffee")
script.Parent.Parent.Enabled = false
elseif script.Parent.Parent.Ordering.Text == "acid" or "Acid" then
script.Ordered:Play()
script.Parent.Parent.Ordering.Text = ""
game.ReplicatedStorage.SCP.SCP294.Cloning:FireServer("acid")
script.Parent.Parent.Enabled = false
else
script.Error:Play()
script.Parent.Parent.Ordering.Text = ""
script.Parent.Text = "Error"
task.wait(1)
script.Parent.Text = "Order"
end
end)
game.ReplicatedStorage.SCP.SCP294.Cloning.OnServerEvent:Connect(function(plr, a)
local t = game.ServerStorage.Drinks[a]:Clone()
t.Parent = plr.Backpack
end)
Client
Server
question is why it readed on first if
💀
like
I type Acid in textbox
it's give you milk
thats acid but in a milk box :>
look try checking the text of thee textlabel in the server.
instead of checking the client
just fire the server
so you want me check through the playergui
?
you can just do a variable like local textthing = your label.text here
and fire the server
let the server check it
ok I'll try
** You are now Level 2! **
wait no I don't think so
if you do like that
wait acually
no
nvm
not yet
I'm scripting
alr let's see
** You are now Level 1! **
yeah how
BRO WHAT
EVEN SERVER BRO
IT'S GIVE YOU MILK
EVEN I TYPE NOTHING
?
yes
so
💀
how can I fix it then
wait I have idea
if textbox lost focus
is save data to int value thing
and then
when you click run the script
I mean
click the button
it send to another value
and put changed conditions
damn
ok
I'll try
script
how the hell
💀
fr
you could use another remoteevent to prevent this form happening.
if the roblox lua system bug is the case
hm
already use bro
💀
thing I should do is like
if you click
it will clone you a checking script
damn
that will
perfect punctuation!
** You are now Level 3! **
ineed help with my post. 🙂
** You are now Level 2! **
@proper salmon
script.Parent.FocusLost:Connect(function(a)
if script.Parent.Text == "Milk" or "milk" then
script.Parent.Parent.Number.Value = 1
elseif script.Parent.Text == "Coffee" or "coffee" then
script.Parent.Parent.Number.Value = 2
elseif script.Parent.Text == "Acid" or "acid" then
script.Parent.Parent.Number.Value = 3
end
end)

acually
** You are now Level 3! **
you don't need it
@proper salmon the problem is not in mouseclickbutton1
I move it into another script
still broken
yeah let me revive focus lost system
like when you done type
it detect what you did
YES LOL
OMG
BRO
BRO
BRO
WORKED
ALL I DID IS
DO FOCUSED LOST
LOL
@proper salmon thanks for helping me btw
@potent needle you too
@proper salmon you also
bro
wait
it still
HAPPEN
WTF
damn
I gonna die
what da hell
I do like this
script.Parent.FocusLost:Connect(function(a)
if script.Parent.Text == "Milk" or "milk" then
script.Parent.Parent.Number.Value = 1
elseif script.Parent.Text == "Coffee" or "coffee" then
script.Parent.Parent.Number.Value = 2
elseif script.Parent.Text == "Acid" or "acid" then
script.Parent.Parent.Number.Value = 3
end
end)
and then thing is
it give you value 1
by don't care any shit
bro
sure
YES IT GIVE ME ACID
LOL
IMAGINE
** You are now Level 3! **
It ok
OH MY GOD
** You are now Level 4! **
I KNOW IT NOW
@proper salmon
I NEED TO DEFINE FIRST
local x = script.Parent.Parent.Ordering.Text
YOU CANNOT DO script.Parent.Parent.Ordering.Text
OMG
The conditions in your if statements are not being evaluated correctly.
you should do it something like this way
if script.Parent.Parent.Ordering.Text == "milk" or script.Parent.Parent.Ordering.Text == "Milk" then
-- your code for ordering milk
elseif script.Parent.Parent.Ordering.Text == "coffee" or script.Parent.Parent.Ordering.Text == "Coffee" then
-- your code for ordering coffee
elseif script.Parent.Parent.Ordering.Text == "acid" or script.Parent.Parent.Ordering.Text == "Acid" then
-- your code for ordering acid
else
-- your code for handling other cases
end
In your original code, the conditions "milk" or "Milk", "coffee" or "Coffee", and "acid" or "Acid" are always evaluated as true because non-empty strings are truthy in Lua.