Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

IntValue not changing from fired RemoteEvent?

Asked by
0xfL 0
4 years ago
Edited 4 years ago

Hello, I'm currently making a "drop money" gui, my issure right now is that when i create a IntValue within the "money" part, the intvalue doesn't change when i execute amount.Value = <value> Here's my code:

function spawnMoney(plr)
    if plr.Parent.Name == "Players" then
        print(plr.Name)
        local txt = game.Players:FindFirstChild(plr.Name).PlayerGui.MainGui.dropMoney.amnt
        local amnt = txt.Text
        local money = game.ReplicatedStorage.Money
        local dupe = money:Clone()
        local player = workspace:FindFirstChild(plr.Name)
        local pos = player.Head.Position
        dupe.Parent = workspace
        dupe.Position = pos
        local amount = Instance.new("IntValue", dupe)
        amount.Name = "Amount"
        amount.Value = txt:FindFirstChild("wrth").Value -- This is where im having issues
        print("Money amount set to ".. amount.Value)
    end
 end

Any help is appreciated!

0
Hey man, could you reformat your code using the lua code blocks and better indentation? This is really hard to read! Psudar 882 — 4y
0
Sure, ill see if i can lol 0xfL 0 — 4y
0
Well, it seems like it can’t find “wrth” in the path. What are you using as the arg for “plr” when calling the function? msuperson24 69 — 4y
0
Heres the rbxl file for you to have a look at https://www.dropbox.com/s/kjpfydxndk6sx32/DarkRP.rbxl?dl=0 0xfL 0 — 4y
View all comments (3 more)
0
Bump, any help? 0xfL 0 — 4y
1
Is this script being run from the client or the server? Professor_Boxtrot 136 — 4y
0
I've included a rbxl file for you to take a look at, the script is being fired from a remoteevent (due to cloning parts from ReplicatedStorage to workspace, the "wrth" value is a IntValue within the player's GUI (which i get the players name from on line 1 and 2 (print(plr.Name) prints the users name). All is working fine besides when i try to change the IntValue "Amount" that is being created 0xfL 0 — 4y

Answer this question