#luck change
1 messages · Page 1 of 1 (latest)
idk
Not what the channel is for.
yes it is
Well considering the post guidelines say
4️⃣ We won't write scripts for you. This forum channel is solely for asking questions.
We can try and guide you, but can't make it for you.
If you show us the code it may help.
If you take a look at the TextBox gui (https://create.roblox.com/docs/reference/engine/classes/TextBox) that'd be a good place to start. You'd have to make it custom to limit the input to only numbers by its OnPropertyChanged("Text") event and replacing the text
Then use that to change the threshold you check for
no hate bt are u a clanker
u type allat so fast
Sounds like hate to me
nft ahh pfp

yea but how u type allat that fast
Doesn't mean it's suddenly allowed...?
gah
Because I've been typing all my life...?
dang but with the links and evrthing
(I had this PFP commissioned quite a few years ago)
i was just guessing
i keep procastinating scripting😢
i think i can figure this out but i really just want to know how do i change the math.random luck
somehor
w
So how do you check if the math.random check passed? If I know that I can help guide you
huh
So have a simple math.random script
Lemme see
it generates random number on button click
script.Parent.MouseButton1Click:Connect(function()
rng = math.random(1,10000000)
RollValue.Value = rng
end)
really simple
id say
Okay, but I need to see where you use that RollValue's value
RollValue.Changed:Connect(function()
if RollValue.Value <= 10000000 then
game.ReplicatedStorage.Transform:FireServer("Common")
end
if RollValue.Value <= 2000000 then
game.ReplicatedStorage.Transform:FireServer("Uncommon")
end
end)
Okay, so that first if is going to run no matter what, as you're rolling a 10,000,000 die, and saying all values at 10,000,000 and below will be "Common", so that's every value
I'd suggest going from lowest chance to highest for if-statements
but to increase the chance for any one type, increase the number on the right side of the check
so RollValue.Value <= 9_000_000 is a lower chance than RollValue.Value <= 10_000_000
i understand but i dont
That's okay, you can ask all the questions you need to.
What do you understand, and what do you not understand?
well i dont know how to go from lowest to highest chance and why do i need to
you need to change the order of those if-statements there
https://create.roblox.com/docs/tutorials/fundamentals/coding-3/intro-to-if-statements
But it looks like it's not an if-else, so I guess that doesn't matter, but you'll have an issue for a low value sending a bunch of signals, as lets say 100 is less than both 10,000,000 and 20,000,000, so it'd send "Common" and "Uncommon"
so do i change it to elseif?
Yes, that'd be a good plan, just making sure you're checking for the lowest chances first
https://create.roblox.com/docs/tutorials/fundamentals/coding-3/multiple-conditions (<- details on if-else statements)
We're not changing how the roll happens, just how we react to what was rolled.
Though you cannot get a roll greater than 10,000,000, so the 20,000,000 check will always happen
@smoky rock I actually have to finish something in game. So ill let you know when we can do this again.
Feel free to ping when you need anything else.
Does the rarities have to be in order?
if you're doing an if-else yes
what if i have 2 exact same raities does it matter?
like with same chance
oh and- can you just tell me how to kill local player using script?
@smoky rock
Only one of the two would be called, not both (with an if-else)
What do you mean?
...
well it sounds stupid but
i need 2 rarities with same chance
so if i make another if
then i can make the other
Why do you need two rarities with the same chance?
well... ig ill just change the chance to sometin different
I suppose that is a good question.
You could have another dice roll in the if condition for that one chance to see which of the sub-rarities it could be
oh i can just make the chance like .0001 higher and it will be the samew
Sure
@smoky rock why cant i label the local player character in regular script?
You cannot use Players.LocalPlayer in a server script
** You are now Level 8! **
@smoky rock how can you make the player respawn faster?
Click on "Players" in the explorer, change the "RespawnTime" property
ok
@smoky rock uhh wanna do the luck change thing?
why
I'm busy?
Are you asking if I have time to help or do it for you? I have time to help, but not make it for you