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

How do I change a value with a remote event? [closed]

Asked by 3 years ago
Edited 3 years ago

my code

local reload_sound = script.Parent.Reload
local tool = script.Parent
local handle = tool.Handle
local userInputService = game:GetService("UserInputService")
local debounce = false
local player = game:GetService("Players").LocalPlayer



userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
        if input.KeyCode == Enum.KeyCode.R then
            if tool.Parent == player.Character and script.Parent.AmmoValue.Value < 30 then
                reload_sound:Play()
                script.Parent.AmmoValue.Value = 30 -- what i want to change
            else

            end
        end
    end)

Closed as Not Constructive by JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?