I’m making a custom vignette changer.
When I put in an ID, it doesn’t change the vignette to the inputted id.
Script to set the image to the inputted id:
local textbox = script.Parent.Parent.TextBox
local ImageChangerreal = game:GetService("ReplicatedStorage"):WaitForChild("ChangeImage")
script.Parent.MouseButton1Click:Connect(function()
local id = textbox.Text
if id == "" then
warn("YOU FORGOT TO PUT AN ID IN!!")
else
if ImageChangerreal then
ImageChangerreal:Fire(id)
end
print("got it")
end
end)
And this is the script to show/paste the id in.
local rep = game:GetService("ReplicatedStorage"):WaitForChild("ChangeImage")
rep.Event:Connect(function(id) -- This part is problematic.
script.Parent.Image = "rbxassetid://"..id
end)
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(i, c) -- This part is completely fine.
if i.KeyCode == Enum.KeyCode.J then
if c then return end
script.Parent.Parent.Visible = not script.Parent.Parent.Visible
end
end)
local textbox = script.Parent.Parent.TextBox
local ImageChangerreal = game:GetService("ReplicatedStorage"):WaitForChild("ChangeImage")
script.Parent.MouseButton1Click:Connect(function()
local id = textbox.Text
if id == "" then
warn("YOU FORGOT TO PUT AN ID IN!!")
else
if ImageChangerreal then
print("MouseButton1Click: "..id)
ImageChangerreal:Fire(id)
end
print("got it")
end
end)
local rep = game:GetService("ReplicatedStorage"):WaitForChild("ChangeImage")
rep.Event:Connect(function(id) -- This part is problematic.
print("Connection Event: ".. id)
script.Parent.Image = "rbxassetid://"..id
end)
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(i, c) -- This part is completely fine.
if i.KeyCode == Enum.KeyCode.J then
if c then return end
script.Parent.Parent.Visible = not script.Parent.Parent.Visible
end
end)
Weird, maybe you can try and convert the string to a number… no clue
local rep = game:GetService("ReplicatedStorage"):WaitForChild("ChangeImage")
rep.Event:Connect(function(id) -- This part is problematic.
print("Connection Event: ".. id)
script.Parent.Image = "rbxassetid://"..tonumber(id)
end)
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(i, c) -- This part is completely fine.
if i.KeyCode == Enum.KeyCode.J then
if c then return end
script.Parent.Parent.Visible = not script.Parent.Parent.Visible
end
end)
Tries to fix it with roblox studio’s AI but to no avail.
Both scripts are Local Scripts though and I’m using a BindableEvent since I’m doing the client-client.
If this is the solution i’m going to lose it, every time i set my image to an Image Asset in my game i am always able to do it without doing that? If this is the solution its good to know in the future.