hi people,
Im making a sort cash system the current script is a server script and every name is correct and checked 10 trillion times, this thing seems logic to me but it doesnt seem to work:
local m = game.ReplicatedStorage.Money
local m2 = game.ReplicatedStorage.Multiplier
script.Parent.DoeDan.OnServerEvent:Connect(function(plr)
while wait(0.5) do
if m and m2 then
m.Value -= 10
m2.Value = 2
end
end
end)
i want to subtract 10 money from the intvalue as seen in the script, its not working and i did some debuging and found out not event this worked:
local r = script.Parent.DoeDan
script.Parent.Activated:Connect(function()
print("FIRREFRGGGT")
end)
its a text button… Not functioning as it should, this is the hiarchy:
this is breaking my brain and any time/ help is appreciated
Well based on what you said in your local script it does not fire the event You’ll need to r:FireServer() and remote events (Thedoedone one) must be placed in replicated storage
It might not be working because you are checking when the gui in starter gui is activated, and that never activates. So you need to define the gui you want to check through playerGui.
The gui from starterGui are replicated into PlayerGui so you don’t have to worry about how to name them. The only difference is that player gui is what the player can interact with so you can hook up events and what not.
Well I know for sure remote events wont work if u place them inside of a local script so the first step would be to put in replicated storage and modify your code
It worked for me, it might just be an issue with your remote event. Test out the script I made in a new baseplate. Add a screenGui to starterGui and a textbutton under it. Then in stater player scripts add this:
local gui = player.PlayerGui:WaitForChild("ScreenGui").TextButton
local testGui = game:GetService("StarterGui"):WaitForChild("ScreenGui").TextButton
gui.Activated:Connect(function()
print("activated")
end)
testGui.Activated:Connect(function()
print("activated test")
end)
Quick tip: try using " ```" before u give a script to make it as a script, thought saying that. That scriptu gave me did not work, yeah. Studio broken or something