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

Why does the remote not fire from ProximityPrompt? - SOLVED

Asked by 3 years ago
Edited 3 years ago

Hi. This is a little bit complicated. Theres a place in my game where u can go and take some grapes. I put a ProximityPrompt so every time u click it, it will give u some grapes. And that works too. But in the game I also have an objective and a hint on the screen in the top left. I want that to change after the player took some grapes. So to do that I made a StringValue in ReplicatedStorage so I can change it easily through remotes. After you press play in the game it sets the objective and hint successfully with the remote. But I also want it to change when the player takes the grapes. I just can't get it to work, and I dont know why. I dont get any error when I take the grapes. It just leaves the objective and hint as the same thing. (I get the grapes btw, it just doesnt change the objective and hint)

Local Script in part where the ProximityPrompt is

local remote = game.ReplicatedStorage.Remotes.Task2

script.Parent.ProximityPrompt.Triggered:Connect(function()
    remote:FireServer()
end)

Script in ServerScriptService for objective and hint 2

local remote2 = game.ReplicatedStorage.Remotes.Task2
local hint2 = game.ReplicatedStorage.Values.Hint
local objective2 = game.ReplicatedStorage.Values.Objective

remote2.OnServerEvent:Connect(function()
    objective2.Value = "Objective: Find a way out."
    hint2.Value = "Hint: Leave."
end)
0
you cant use LocalScript inside Workspace jerryisgod29 176 — 3y
0
How do I then make the script send a remote? I've already tried it but failed. purplxboi 2 — 3y
0
Can't really think of an answer, I guess you should read about client to server communication. CjayPlyz 643 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I found out how to solve this. Just took some time to read https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events and understand everything.

Ad

Answer this question