I checked through the website and all of the results i wanted didnt help fix my issue so i am now asking for help. I am having an issue with a gui changing script where the printing works properly but hte GUI doesnt update at all. the code is:
--instances local Player = game:GetService("Players").LocalPlayer local Text = script.Parent.Text local Color = script.Parent.TextColor local Textchange = script.Parent.TextChange --functions local function SetText(Ammo, Ammocap) print(Ammo.."/"..Ammocap) print("before if argument") if Ammo / Ammocap < 1.5 then Color = Color3.new(0.807843, 0, 0) print("in if argument") end print("after if argument") Text = Ammo.."/"..Ammocap end --function connects Textchange.Event:Connect(function(Ammo, Ammocap) print("triggered Bindable Event") SetText(Ammo, Ammocap) end)
alos i am certain that all of my instances are correct, hte text just doesnt update correctly
I would recommend testing if tostring()
works. I'm assuming Ammo
and Ammocap
are ints, meaning when you try to append a string to them it doesn't automatically change them. So test if this works on line 15: Text= tostring(Ammo).."/"..tostring(Ammocap)
, if it does please mark this as the answer, otherwise comment on this if there's an error or anything! Good Luck