hi guys i’m new here i need help
RemoteEvents is not a valid member of ReplicatedStorage “ReplicatedStorage”
why it keep saying this
local addoil = game.ReplicatedStorage.RemoteEvents.AddOil
local pick = script.Parent.ClickDetector
pick.MouseClick:Connect(function(oil)
addoil:FireClient(oil)
for i, v in pairs(script.Parent.Parent:GetChildren()) do
v.Transparency = false
end
end)
here guys the script its for the oilpick script
i made this because i want the player to click to get money
this is the item but for later i will script it but my problem when i click i need it to disappear the fuel object i will add that later
guys this is the scrpt for leaderstate
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local Oil = Instance.new("IntValue")
Oil.Name = "Oil"
Oil.Value = 1000
Oil.Parent = leaderstats
local RocketFuel = Instance.new("IntValue")
RocketFuel.Name = "RocketFuel"
RocketFuel.Value = 0
RocketFuel.Parent = leaderstats
end)
1 Like
Mystxry12
(Mystxry)
September 30, 2021, 3:23pm
#2
You wrote RemoteEvents whereas the name of it is actually RemoteEvent without the s.
Also where is the Addoil parented to the remoteevent?
2 Likes
addoil is not a valid member of RemoteEvent “ReplicatedStorage.RemoteEvent”
this other error came up
Mystxry12
(Mystxry)
September 30, 2021, 3:26pm
#4
local addoil = game.ReplicatedStorage.RemoteEvent
--stuff
addoil:FireClient(oil)
Mystxry12
(Mystxry)
September 30, 2021, 3:27pm
#5
There is no addOil thing parented to the remotevent
i’m trying to know should i drag it to the remote event
Mystxry12
(Mystxry)
September 30, 2021, 3:29pm
#7
Drag what? Could u explain? Just fire the remoteevent.
here is the video showing what is happening now
Mystxry12
(Mystxry)
September 30, 2021, 3:36pm
#10
Local script
local addoil = game.ReplicatedStorage.RemoteEvent
local pick = script.Parent.ClickDetector
pick.MouseClick:Connect(function(oil)
addoil:FireServer(oil)
for i, v in pairs(script.Parent.Parent:GetChildren()) do
v.Transparency = false
end
end)
1 Like
i added it to the hitbox but i see adding it
Mystxry12
(Mystxry)
September 30, 2021, 3:43pm
#13
Then in another script in serverscriptservice
YourRemoteEvent:OnServerInvoke:Connect(function(plr, oil)
--your transparency stuff here
end)
Mystxry12
(Mystxry)
September 30, 2021, 3:56pm
#14
Heres the whole code
Script(not local script my mistake) in ur Hitbox part
local addoil = game.ReplicatedStorage.RemoteEvent
local pick = script.Parent.ClickDetector
pick.MouseClick:Connect(function(oil)
addoil:FireServer(oil)
end)
A script in ServerScriptService
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerInvoke:Connect(function(plr, oil)
game.Workspace.Fuel.Hitbox.Transparency == 0
end)
Mystxry12:
local addoil = game.ReplicatedStorage.RemoteEvent
local pick = script.Parent.ClickDetector
pick.MouseClick:Connect(function(oil)
addoil:FireServer(oil)
end)
A script in ServerScriptService
local event = game.ReplicatedStorage.RemoteEvent
RemoteEvent.OnServerInvoke:Connect(function(plr, oil)
for i, v in pairs(oil:GetChildren()) do
v.Transparency = false
end
end)
thank you very much let me try
Mystxry12
(Mystxry)
September 30, 2021, 4:03pm
#16
I updated the post there were some errors
Mystxry12
(Mystxry)
September 30, 2021, 4:04pm
#17
This will work for both client and server.
i created a new scrpit now in serverstorage
Mystxry12
(Mystxry)
September 30, 2021, 4:10pm
#20
Heres the whole code
Script(not local script my mistake) in ur Hitbox part
local addoil = game.ReplicatedStorage.RemoteEvent
local pick = script.Parent.ClickDetector
pick.MouseClick:Connect(function()
addoil:FireServer()
end)
A script in ServerScriptService
local event = game.ReplicatedStorage.RemoteEvent
event.OnServerInvoke:Connect(function(plr)
game.Workspace.Fuel.Hitbox.Transparency == 0
end)
Another updated version sigh…