Scripting Help Needed

Sounds like a good sign! Could you screenshot your explorer for me? Make sure the explorer is showing the UI that you wish to use with rewards.

First, go to the Script and change DataStoreService:GetDataStore(‘RewardsDataStore’, ‘001’) to DataStoreService:GetDataStore(‘RewardsDataStore’, ‘000’). This is to reset the rewards system as you probably have already received your reward for today and won’t get the UI to show up.

Then, create a LocalScript inside of Daily Reward GUI and paste in the code below. Let me know what happens.

-- LocalScript
 
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
 
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local createPopupRequest = ReplicatedStorage:WaitForChild("remoteFunction")
 
local function onCreatePopupRequested()
	local ImageLabel = script.Parent.ImageLabel
	ImageLabel.Visible = true
	
	local closeButton = script.Parent.ImageButton
	closeButton.Visible = true
 
	closeButton.MouseButton1Click:Wait()
	closeButton.Visible = false
	ImageLabel.Visible = false
end
 
createPopupRequest.OnClientInvoke = onCreatePopupRequested

Should I keep the local? It shows an error for this mark: ‘. “Expected identifier got red question mark sign”.

Keep the LocalScript. Just make sure you update the Script’s code and replace it with this.

local RewardDataStore = DataStoreService:GetDataStore('RewardsDataStore', '000')

That’s the same as what OP wrote. There’s no difference between setting the OnInvoke of a RemoteFunction this way.

RemoteFunction.OnClientInvoke = function()

function RemoteFunction.OnClientInvoke()

Same with if you do it in code.

local func = function()

function func()

I’m going to ignore the fact that there is functional difference in the above one beyond syntax but the point is that they’re the same way to define a function.

2 Likes

Looking at it again, that makes sense. Before I thought that was the only way of doing it. Thanks.

Yup, it would be more easier that way lol.