#pls help me
1 messages · Page 1 of 1 (latest)
BindableEvent / BindableFunction. For client -> client or server -> server communication
huh? (im beginner 💀)
oh
Sorry about that. Had something previously copied that got pasted instead of the link I thought I copied. I edited the message!
actually i think i have a better idea: how to make clicking a button in client generate a random number in another localscript
BindableEvent, or BindableFunction
so the button should fire bindable function/event?
bro i do not understand this what
** You are now Level 1! **
Use BindableEvents
i have one in rs
Instead of :FireServer or :FireAllClients / :FireClients
Its
:Fire
and
.Event
its pretty simple
I don't think you read what I linked, it had example code
i did
its actually SUPER simple.
wait i might cook
this is what i have in the button:
local RollEvent = game.ReplicatedStorage.Roll
script.Parent.MouseButton1Click:Connect(function()
RollEvent.Event:Connect(function(data)
math.random(1,100)
end)
end)
let me simplify this for u bbg
idk why did you call me tht but better than me strugglin with this all nigh
Wait wait wait, whats the button suppoesd to do?
tysm
local a=game:GetService("ReplicatedStorage"):WaitForChild("\82\111\108\108")
local b=script.Parent
b["MouseButton1Click"]:Connect(function()
local c=math["random"](1,100)
print("\82\111\108\108\58\32"..tonumber(c))
a:Fire(c)
end)

... why is there 82 11 108 108
im playing
local RollEvent: BindableEvent = game.ReplicatedStorage:WaitForChild("Roll") :: BindableEvent
script.Parent.MouseButton1Click:Connect(function()
local randomNumber: number = math.random(1, 100)
print(randomNumber)
RollEvent:Fire(randomNumber)
end)
RollEvent.Event
you typed it in your other script
but you used it incorrectly
IntValue
no i did that myself i just dont know
** You are now Level 2! **
like i get it yall are pros
like what
90% of gamblers quit before they win big..
there are 3 ppl helping me
with stupid
may you at least show us your scripts
thats in button
thats. in. localscript.
yes
you gave me the script yourself, i just modified it
tsk tsk tsk.
B WHAT?!
b=script
bro youre
wait no this one
he is
its this one
definetly not
the 1st or 2nd
shush
the 2nd totally works
why do you type annotate randomNumber
uhh anyone here?
local RollEvent = game.ReplicatedStorage:WaitForChild("Roll")
script.Parent.MouseButton1Click:Connect(function()
local randomNumber = math.random(1, 100)
print(randomNumber)
RollEvent:Fire(randomNumber)
end)
why are you guys even using bindableevents those are sht
true
this
for server to server communication?
or local to local?
just tell me a way to do this and youll never see me again i swear
what is reccomended then
?
so much
I usually use the signal moduel and then have a module that contains all my signals
so much what
teach me this power
intvalue stores numbers
🤯
u use
the button script
to generate the random number
u change the intvalues value to the number
u read the changed value of the intvalue in the other script
how to read tht
IntValue.Value
generate number
save number
other script notices it changed
run thing
????
depends if he wants it to run when it changes immediately
cuh

local RollButton = script.Parent
local RollValue = game.ReplicatedStorage.RollValue
local rng
script.Parent.MouseButton1Click:Connect(function()
rng = math.random(1,100)
RollValue.Value = rng
end)
is this it?
omgg
funny how you made rollbutton variable and not even use it
skidded
tsk tsk tsk
jk

go back to #🏃︱animating
actually ill go back to animating if you deal with this dude
https://discord.com/channels/448986884497211392/1358491002167623721
im not dealing with ts 😭
yo guys
or dont help ppl if u dont have patientce
kid
good luck 
it sends me this
Players.MOO_OOOI.Backpack.Roll:15: attempt to compare Instance <= number
why
if RollValue <= 100 then
print("idk)
end
** You are now Level 3! **
@forest minnow u still here?
ok
RollValue.Value
ohh
thanks
one last thing:
if RollValue <= 100000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
end
it somehow doesnt fireserver when you click the button
@forest minnow
RollValue.Value
i did that
local RollValue = game.ReplicatedStorage.RollValue.Value
no u gotta do that manually
bro why bruh
if at the start its 0, here its 0
everytime
when u do .Value everytime it reads the value that is now
not when at the start of the game
OH
IT
STILL
DOESNT WORK
THERE IS NO OUTPUT
IT JUST REFUSES TO DO ANYTHING
it doesnt even check for the value
@forest minnow please i beg
send scripts
local RollValue = game.ReplicatedStorage.RollValue
if RollValue.Value <= 100000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
print("rolled common")
end
if RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
print("rolled uncommon")
end
it rolls between 1 and 100000000
@forest minnow
can i get the full script tho
wdym
local player = game.Players.LocalPlayer
local Sound1m = workspace.World.Sound1m
local SoundSecret = workspace.World.SoundSecret
local SoundRoll = workspace.World.SoundRoll
local RollRemote = game.ReplicatedStorage.Roll
local RollValue = game.ReplicatedStorage.RollValue
--local RollButton = game.StarterGui.ScreenGui.RollButton
local rng = 100
--Non-Secrets
if RollValue.Value <= 100000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
print("rolled common")
end
if RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
print("rolled uncommon")
end
this is what i have
i set the int value to 100000000
dont mind the locals at the top
@forest minnow the button script works
???
@forest minnow
shhh
local player = game.Players.LocalPlayer
local Sound1m = workspace.World.Sound1m
local SoundSecret = workspace.World.SoundSecret
local SoundRoll = workspace.World.SoundRoll
local RollRemote = game.ReplicatedStorage.Roll
local RollValue = game.ReplicatedStorage.RollValue
--local RollButton = game.StarterGui.ScreenGui.RollButton
local rng = 100
--Non-Secrets
if RollValue.Value <= 100000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
print("rolled common")
end
if RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
print("rolled uncommon")
end
not fixed just applying format
wait
uhh ok
ye
also why are ther 2 ifs instead of elseif
pretty sure i said tht
wait
** You are now Level 4! **
if RollValue.Value <= 99999999 then
game.ReplicatedStorage.Transform:FireServer("Common")
print("rolled common")
elseif RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
print("rolled uncommon")
end
like this @forest minnow
yes but what is the issue
well i think it doesnt read the value
cuz nothing under the if executes
then try setting the value to 0
idk man debug it or make a new post im helping another dude rn
yuh
cuz it doesnt even work idk
local RollButton = script.Parent
local RollValue = game.ReplicatedStorage.RollValue
local ValueLabel = RollButton.RollLabel
local rng
script.Parent.MouseButton1Click:Connect(function()
rng = math.random(1,100000000)
RollValue.Value = rng
ValueLabel.Text = RollValue.Value
end)
this is the button
local RollValue = game.ReplicatedStorage.RollValue
--Non-Secrets
if RollValue.Value <= 100000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
print("rolled common")
elseif RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
print("rolled uncommon")
end
this is the script
local*
this isj ust a number value RNG correct?
yes
ok so no need for IntValues
i just need the button to get random number into another script
what is blud typin so long
--localscript 1
local button = script.Parent
local NumVal = pathtonumvalue
button.MouseButton1Click:Connect(function()
rng = math.random(1,10000)
NumVal.Value = rng
end)
-- localscript 2
local rollval = pathtovalue
rollval.Value.Changed:Connect(function()
-- example code to use this
if rollval.Value <= 100 then
print("you suck.")
elseif rollval.Value >= 1000 then
print("ok cool..")
elseif rollval.Value >= 5000 then
print("amazing")
elseif rollval.Value == 10000 then
print("lucky")
end
end)
its basically on where the value is located
so the intvalue?
You can use a NumberValue instead, but im not sure about an IntValue
Never used it that much
But if it works it works
🤷♂️
@carmine crown the .Changed doesnt work
u there?
Players.MOO_OOOI.Backpack.Roll:8: attempt to index number with 'Changed'
@carmine crown
@carmine crown
huh
the output
.
** You are now Level 5! **
Oh, i did it wrong
its not
rollval.Value.Changed:Connect(function()
its
i see
rollval.Changed:Connect(function()
change the
rollval.Value.Changed:Connect(function()
oh my god
no way
it..
it
works
@carmine crown youre the best i love you
omggg
tysm
np
Maybe read the documentaries someday
which?
oh and this Youtube Dev is helpful aswell
You already know the basics?
like the veeery base ones
im not even a beginner i just ... idk copy?
Ooh.. Bad Habit
Used to do the same
well it doesnt matter now i am just happy i dod this
Dont copy from others, it wont end up well.
yeah but like you gotta learn before actually trying something yourself
Especially if you dont know what your doing
I'd reccomend watching both
Just to spark your mind up a little